-
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: keep empty line between lists #2598
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.
리뷰 완료합니다. 맥락이 부족하여 ToMdConvertorState 클래스 내부까지만 좀 살펴봤는데, 코멘트 남겨주신 부분 확인하고 변경 가능하면 변경해주시는게 좋을 것 같아요.
const prevDelim = state.getDelim(); | ||
|
||
state.setDelim(''); | ||
state.write('<br>'); | ||
|
||
state.setDelim(prevDelim); |
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.
동작이 wrapBlock
이라는 메서드와 유사해 보이네요.
tui.editor/apps/editor/src/convertors/toMarkdown/toMdConvertorState.ts
Lines 116 to 124 in d39270a
wrapBlock(delim: string, firstDelim: string | null, node: Node, fn: () => void) { | |
const old = this.delim; | |
this.write(firstDelim || delim); | |
this.delim += delim; | |
fn(); | |
this.delim = old; | |
this.closeBlock(node); | |
} |
손쉽게 외부에서도 delim을 다루기 위해 메서드를 만든 것 까진 좋은데, ToMdConvertorState
클래스 내부에서는
setDelim
메서드를 쓰지 않고 this.delim
에 할당을 하는 동작이 마구 일어나고 있으니 코드에 일관성이 없어 보여요.
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.
내용이 두개로 나뉘어야했는데 리뷰를 읽다가 하나로 뭉쳐졌나보네요.
- 지금 작성한 부분은
wrapBlock
으로 대체가 안되는지 get/setDelim
메서드가 만들어졌으니this.delim
을 다룰 때 해당 클래스의 모든 연관 동작이 수정되어야 하지 않느냐
위 두개는 다른 맥락이었어요.
무튼 리뷰 반영된 코드에는 wrapBlock
만 get/setDelim
만 적용하고 있는데, flushClose
, write
메서드도 같은 변경이 필요해요.
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.
리뷰 완료합니다.
* fix: keep empty line between lists * fix: remove delimiter when add empty line between list items * 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
<br>
.As-Is
To-Be
Thank you for your contribution to TOAST UI product. 🎉 😘 ✨