nhn / tui.editor

🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.

Home Page:http://ui.toast.com/tui-editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Indentation in front of HTML block crashes WYSIWYG editor

jadham2 opened this issue · comments

Describe the bug

CommonMark specification and GFM specification specifies that start conditions for HTML blocks can be indented by up to three spaces. after >= 4 spaces, it becomes a code block (correct behavior). The current regex for reHTMLTag only looks at tags immediately starting on a line. This causes it to crash when displaying in WYSIWYG mode since it can not match the tag.

To Reproduce

Steps to reproduce the behavior:

  1. Enter Markdown mode
  2. Type any HTML tag with 1-3 spaces in front of it
  3. Attempt to switch to WYSIWYG mode

Expected behavior

The tag should be matched and treated as a normal HTML tag.

Desktop (please complete the following information):

Browser: Firefox v121.0

Additional context

"@toast-ui/react-editor": "^3.2.3"