tui.editor
tui.editor copied to clipboard
WYSIWYG editor removes HTML tags
Describe the bug
The WYSIWYG editor inconsistently removes html tags and otherwise damages the source content, regardless of what HTML sanitizer is being used.
To Reproduce
Steps to reproduce the behavior:
- open the Using Custom HTML Sanitizer example in the documentation.
- Insert some valid HTML code in the Markdown area.
<h1>Some code that will be destroyed</h1>
<p>This code will be damaged by the WYSIWYG editor.</p>
- Switch from Markdown to WYSIWYG, then back. Observe that some of the content has been changed.
<h1>Some code that will be destroyed
</h1>This code will be damaged by the WYSIWYG editor.
- Repeat steps 2 and 3 in the Basic Example that does not use a custom sanitizer. The same content is changed in the same way.
Expected behavior
Expected HTML code to be retained, and only changed by the sanitizer specified.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Windows
- Browser Chrome
- Version 86.0.4240.111
@breezystatic77 Paragraph is created by default in the Markdown editor. So you don't need to create a paragraph using the <p>
HTML string, and it's correct that the P tag disappears when converted from WYSIWYG to Markdown. However, the part where the line breaks before and after </h1>
seems to be a bug and needs to be fixed.
Also, if you type something like this:
fdsfdsfdsa
DFSAfds
gfdhdgjhjhg
jhjhhfgjhjgf
JHGhjgjhg
and switch to markdown it will produce something like this:
fdsfdsfdsa DFSAfds
gfdhdgjhjhg
jhjhhfgjhjgf
JHGhjgjhg