froala / wysiwyg-editor

The next generation Javascript WYSIWYG HTML Editor.
https://www.froala.com/wysiwyg-editor
Other
5.28k stars 672 forks source link

html.get() returns content without <p> tags containing zero width space character #3822

Closed unnecessara closed 1 year ago

unnecessara commented 4 years ago
Expected behavior.

html.get should return html content as it exists in the editor.

Actual behavior.

When keepFormatOnDelete flag is set to true, hitting the enter key at the start of a paragraph creates new lines that have a p tag with a zero-width space character

​​

When trying to get the content with html.get, we get the paragraph but not the

tags before it.

Steps to reproduce the problem.
  1. Open the JSFiddle https://jsfiddle.net/sndjkahdaskds/3mpyu19t/4/
  2. Have the browser console open
  3. Put your cursor at the start of the content
  4. Hit enter
  5. Hit the get html button
  6. Watch the result in the console
Editor version.

Reproducible in version 2 and version 3

OS.

macOS Catalina 10.15.1

Browser.

Reproducible in Firefox and Chrome

dcporter44 commented 2 years ago

This is the same issue with table cells. If you double click the text content inside a cell to select the text and then delete it with the delete key, the content is replaced with ZeroWidthSpace. But html.get returns the HTML with the entire cell missing. I'll make another issue for this, but just wanted to bring it up here.

natanaelsimoes commented 1 year ago

+1

ilyaskarim commented 1 year ago

Issue is being fixed in V4.0.5: https://froala.com/wysiwyg-editor/changelog/#4.0.5