Skip to content
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

Necessary <br> tags are removed after switching to WYSIWYG and then back to Markdown mode #1122

Open
mistris opened this issue Jul 22, 2020 · 4 comments

Comments

@mistris
Copy link

mistris commented Jul 22, 2020

Describe the bug

I'm using https://github.com/markdown-it/markdown-it-deflist for definition lists.
After switching to WYSIWYG and then back to Markdown mode, necessary <br> tags are removed and in result definition list can't have multiple lines.
But it's not only about definition lists. Anywhere where I want to use <br> (e.g. inside <p></p> tags), it's not possible, because they are just removed from markdown after switching to WYSIWYG and then back to Markdown mode.

To Reproduce

  1. Use this markdown:
### Definition lists (https://github.com/markdown-it/markdown-it-deflist)

Term 1

: Definition 1
with lazy continuation.<br>
Another line for this definition.
  1. Switch to WYSIWYG mode
  2. Switch back to Markdown mode

Expected behavior

<br> tag should not be removed.

Screenshots

Before switching to WYSIWYG

image

After switching to WYSIWYG and then back to Markdown

image

Environment:

  • Windows 10 64-bit
  • Google Chrome 83.0.4103.116
  • ToastUI editor 2.1.2, 2.2.0, 2.3.0
@mistris mistris added the Bug label Jul 22, 2020
@mistris mistris changed the title Necessary <br> tags are removed Necessary <br> tags are removed Jul 22, 2020
@mistris mistris changed the title Necessary <br> tags are removed Necessary <br> tags are removed after switching to WYSIWYG and then back to Markdown mode Jul 22, 2020
@seonim-ryu
Copy link
Member

@mistris It is difficult to confirm this problem by looking at this alone. I think the code of the markdown-it parser you are using has changed the behavior of the Editor. The default behavior is retained when you switch from WYSIWYG to Markdown when <br> is remained in the paragraph. Could you share the example page with something like the CodePen?

@bdevg
Copy link

bdevg commented Aug 13, 2020

Are you using react?

@mistris
Copy link
Author

mistris commented Aug 13, 2020

No.

@bdevg
Copy link

bdevg commented Aug 13, 2020

Oh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants