nhn / tui.editor

🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
http://ui.toast.com/tui-editor
MIT License
17.12k stars 1.74k forks source link

Switching Between HTML/Markdown #2696

Open livevsonline opened 2 years ago

livevsonline commented 2 years ago

Describe the bug

Switching from HTML with natural line breaks to Markdown will cause invalid HTML tags being inserted into the Markdown

To Reproduce

Type this text into the HTML editor

fdsfdsfdsa

DFSAfds

gfdhdgjhjhg

jhjhhfgjhjgf

JHGhjgjhg

Then switch to markdown and it will produce something like this:

fdsfdsfdsa DFSAfds

gfdhdgjhjhg

jhjhhfgjhjgf


JHGhjgjhg

Notice the
tag? That's not a valid markdown syntax

Expected behavior

I expected the conversion to be valid markdown syntax

Screenshots

If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

Windows 10

kailuowang commented 2 years ago

I noticed that it also happens for partial word style markers. If you select part of word and set a style in either mode, say bold, it will result in a XXXX tag in the markdown after you switch from WYSIWYG to markdown. This bug seems to be introduced by 3.1.0, 3.0.3 doesn't seem to have it.

kailuowang commented 1 year ago

This bug seems to be introduced by 3.1.0, 3.0.3 doesn't seem to have it.

I was wrong. It's a different bug. the
tags are still being added in 3.0.3, the partial word style marker bug was not.

MoritzGiessmann commented 1 year ago

Still reproducible when inserting multiple new lines in WYSIWYG

image