mdx-editor / editor

A rich text editor React component for markdown
https://mdxeditor.dev
MIT License
1.57k stars 124 forks source link

[BUG] Crash when pasting nested list of richtext #498

Closed TomNUSDS closed 3 weeks ago

TomNUSDS commented 3 weeks ago

Describe the bug Pasting nested lists into the richtext editor causes an exception.

To Reproduce Steps to reproduce the behavior:

  1. Go to MDX Editor Live demo site
  2. Clear the content in the richtext editor so it's empty
  3. Open browser debugger to watch for crash
  4. Extract attached richtext example data from test.rtf.zip
  5. Open test.rtf with any editor that supports richtext
  6. Copy content and paste into the MDXEditor richtext area. Result: crashes Uncaught TypeError: Cannot read properties of undefined (reading 'children') at h Note: Switching to Markdown view in MDXEditor shows empty content.

Desktop (please complete the following information):

Additional context The code is minimized, but I think it's in isParent() when the node parameter is null for some reason.

test.rtf.zip

petyosi commented 3 weeks ago

This is a duplicate of https://github.com/mdx-editor/editor/issues/178

TomNUSDS commented 2 weeks ago

Sorry for the duplicate. I did search through the issues, must of just missed it.