JiHong88 / suneditor

Pure javascript based WYSIWYG html editor, with no dependencies.
http://suneditor.com
MIT License
1.74k stars 309 forks source link

Error on Pasting content with image from wiki suneditor-react #1363

Open bishnu476 opened 7 months ago

bishnu476 commented 7 months ago
Screenshot 2024-02-20 at 15 17 28

Pasting content with image from wiki A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://en.wikipedia.org/wiki/Anatomy'
  2. Copy content with image and paste on editor
  3. It will show the runtime error Unhandled Runtime Error NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
  4. Despite showing content in editor, editor is not returning any value

Expected behavior If it got error while paste, editor should allow to handle inside onPaste function or don't show any content on editor.

Screenshots

Screenshot 2024-02-20 at 15 22 23 Screenshot 2024-02-20 at 15 23 52

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context "suneditor": "^2.45.1", "suneditor-react": "^3.6.1", "next": "13.4.4", "react": "18.2.0",