wysiwyg-editor icon indicating copy to clipboard operation
wysiwyg-editor copied to clipboard

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

Open unnecessara opened this issue 5 years ago • 1 comments

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

unnecessara avatar Jan 30 '20 14:01 unnecessara

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.

dcporter44 avatar May 25 '22 21:05 dcporter44

+1

natanaelsimoes avatar Oct 11 '22 12:10 natanaelsimoes

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

ilyaskarim avatar Nov 30 '22 17:11 ilyaskarim