-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: apply toastmark parser to merged table plugin #1011
Conversation
apps/editor/src/js/pluginHelper.js
Outdated
); | ||
} | ||
|
||
return {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plugins
가 없을때를 먼저 체크하고 빈 객체를 반환해주는 조건을 먼저 처리해주면 if
문도 하나 줄고 가독성에도 좋은 것 같아요ㅎ
if (!plugins) {
return {};
}
return plugins.reduce( /* */ );
@@ -0,0 +1,81 @@ | |||
function extractPropertiesForMerge(value, type, oppossitType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oppossitType
-> oppositeType
이용ㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기존 함수의 폐해군요..ㅋㅋ
@@ -0,0 +1,81 @@ | |||
function extractPropertiesForMerge(value, type, oppossitType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
근데 oppositeType
에는 어떤 값이 들어오나요??
퍼블릭 함수는 아니지만 type
이나 oppositeType
값에 대한 주석이 있으면 좋겠습니다.
(이럴때 타입이 없으니 불편하군요 ㅜㅜ)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기존 함수 주석 살려 놓을게요~!
/**
* Extract properties for merge.
* @param {string} value - value
* @param {string} type - merge type like colspan, rowspan
* @param {string} oppositeType - opposite merge type
* if merge type is colspan, opposite merge type is rowspan
* @returns {Array.<number|string>} - returns merge count and value
* @private
*/
|
||
function parserTableCellWithRowspanMap(node, parent, rowspan) { | ||
const prevRow = parent.prev; | ||
const columnLen = parent.parent.parent.columns.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parent
값이 이 값들과 맞나요? parent.parent
값 유무를 체크할 필요는 없을지 궁금해서 질문해봅니다ㅎ
parent = `tableRow`
parent.parent = `tableBody`
parent.parent.parent = `table`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래 같은 경우도 있고 나머지는 말씀하신대로 입니다! 파싱로직 내에서 parent.parent
는 null
인 경우가 없어 별도 체크는 하지 않아도 될 것 같습니다.
parent.parent = `tableHead`
* @fileoverview Test merged table parser | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
*/ | ||
import { source } from 'common-tags'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
에디터 적용하는 피처에 있었는데ㅋㅋㅋ 역시 빠르시군요 👍
]; | ||
|
||
examples.forEach(({ no, content, result }) => { | ||
it(`example1${no}`, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example1${no}
-> example${no}
요렇게 되어야하지 않을까요ㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헉..감사합니다
if (entering) { | ||
inEmph = true; | ||
} else { | ||
inEmph = false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트 코드라 크게 문제되는건 아니지만.. 이렇게 처리할수도 있겠네요ㅎ
inEmph = entering;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commonmark 예제를 그대로 가져오다보니 그렇네요. 수정하겠습니다ㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[6/3] 데모를 띄워보느라 리뷰가 길어졌네요 😭 코멘트 달아둔 것 중에 파싱이 깨지는 경우가 있어서 요 부분 확인 부탁드릴게요! 짧은 시간 내 개발하시느라 고생 많으셨어요ㅎ
|
e7dff24
to
e7b2374
Compare
* feat: chart extension * feat: multiple chart instance * refactor: csv, dsv parser to papa * refactor: apply review (ref #1010) * fix: remove papa global dependency (fix #1011) * refactor: change default chart to column * feat: support whitespace separated values for chart data (ref #1009) * refactor: apply code review (ref #1013)
Please check if the PR fulfills these requirements
fix #xxx[,#xxx]
, where "xxx" is the issue number)Description
Thank you for your contribution to TOAST UI product. 🎉 😘 ✨