nhn / tui.editor

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

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

Open susheelahegde opened 2 months ago

susheelahegde commented 2 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.

bacloud23 commented 1 month 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