-
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
fix: convert by using HTML tag when it is not between spaces #2572
Conversation
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.
리뷰 완료합니다.
const { content } = parent; | ||
|
||
const isFrontNodeEndWithSpace = | ||
index === 0 || isEndWithSpace(content.child(index - 1).text ?? 'a'); |
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.
기본값으로 처리한 'a'
는 공백 문자를 넣으면 isEndWithSpace
혹은 isStartWithSpace
가 제대로 동작하지 않으니까 임의로 넣은 문자인가요?
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.
그러게요. 'a'
가 뭘 나타내는건지 의미를 만들어 상수화 시켜야겠습니다.
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 (betweenSpace) { | ||
delim = '**'; | ||
} else { |
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.
delim
변수를 선언할 때 기본값을 정하고, 분기문은 한번만 둬도 되지 않을까요?
let delim = '**';
if (!betweenSpace) {
delim = entering ? '<strong>' : '</strong>';
}
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.
리뷰 완료합니다.
const { content } = parent; | ||
|
||
const isFrontNodeEndWithSpace = | ||
index === 0 || isEndWithSpace(content.child(index - 1).text ?? 'a'); |
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.
그러게요. 'a'
가 뭘 나타내는건지 의미를 만들어 상수화 시켜야겠습니다.
rawHTML: entering ? getOpenRawHTML(rawHTML) : getCloseRawHTML(rawHTML), | ||
}; | ||
}, | ||
|
||
emph({ node }, { entering }) { | ||
emph({ node }, { entering }, betweenSpace) { |
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.
같이 처리했네요. 좋습니다. 👍👍👍
* wip: convert strong to tag when it is not between spaces * fix: convert strong to tag when it is not between spaces * fix: convertor that follows the same rule * test: add test for convertor * chore: apply code reviews
Please check if the PR fulfills these requirements
fix #xxx[,#xxx]
, where "xxx" is the issue number)Description
**"text"**a
is not parsed.Typing content in WYSIWYG
As-Is
To-Be
Thank you for your contribution to TOAST UI product. 🎉 😘 ✨