tui.editor icon indicating copy to clipboard operation
tui.editor copied to clipboard

WYSIWYG editor removes HTML tags

Open breezystatic77 opened this issue 4 years ago • 2 comments

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:

  1. open the Using Custom HTML Sanitizer example in the documentation.
  2. 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>
  1. 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.
  1. 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 avatar Oct 26 '20 19:10 breezystatic77

@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.

paragraph

seonim-ryu avatar Oct 28 '20 02:10 seonim-ryu

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

livevsonline avatar Aug 25 '22 07:08 livevsonline