nhn / tui.editor

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

getHTML() Method in Toast-UI/Editor Returns Unexpected Value When Editor is Empty #3236

Open susheelahegde opened 7 months ago

susheelahegde commented 7 months ago

Describe the bug

When using the getHTML() method in toast-ui/editor, it consistently returns


instead of null when the editor is empty.

To Reproduce

Steps to reproduce the behavior:

  1. Initialize toast-ui/editor.
  2. Use the getHTML() method when the editor is empty.
  3. See that "


    "
    is returned instead of null.

Expected behavior

The getHTML() method should return null when the editor is empty just like getMarkdown().

Screenshots

image

Additional context

This bug affects the behavior of the getHTML() method specifically when the editor is empty. It may impact applications relying on the returned value to determine whether the editor content is empty or not.

bacloud22 commented 5 months ago

I agree. Same for getMarkdown It grabs things from the HTML of the editor itself. Here in French language you see some values:

For me empty or not !

image