Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specific HTML input breaks WYSIWYG usability #3240

Open
JuliaCasamitjana opened this issue Apr 16, 2024 · 0 comments
Open

Specific HTML input breaks WYSIWYG usability #3240

JuliaCasamitjana opened this issue Apr 16, 2024 · 0 comments
Labels

Comments

@JuliaCasamitjana
Copy link

JuliaCasamitjana commented Apr 16, 2024

Describe the bug

A <pre> element that contains a line break and is nested in a <li> element breaks the WYSIWYG editor usability.

To Reproduce

Steps to reproduce the behaviour:

  1. Go to the editor's demo page
  2. Include the contents from this code-block:
<ul><li>
<pre>
first line

second line
</pre>
</ul></li>
  1. Click to WYSIWYG
  2. See error: Click does not respond. Error message appears in the console:
Uncaught TypeError: Cannot read properties of undefined (reading 'length')
    at Qu (index.js:24150:20)
    at pre (index.js:24355:19)
    at htmlInline (index.js:24744:9)
    at o (index.js:24993:9)
    at e.convert (index.js:25016:7)
    at e.convertNode (index.js:25021:10)
    at e.toWysiwygModel (index.js:26076:18)
    at e.changeMode (index.js:27533:35)
    at index.js:23939:30
    at Array.forEach (<anonymous>)

and preview does not show expected output.

Expected behavior

The expected output in the preview should be the same generated by:

  • first line
    
    second line
    

WYSIWYG button is clickable.

Screenshots

toastui_bug

Desktop (please complete the following information):

  • OS: macOS 14.4
  • Browser Chrome
  • Version 123.0.6312.107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant