react-md-editor icon indicating copy to clipboard operation
react-md-editor copied to clipboard

Deleting <blockquote> in Editor causes Preview Error: NotFoundError - Failed to execute 'removeChild'

Open ghost opened this issue 1 year ago • 2 comments

First, thank you for developing this highly appreciated editor!

I tried to embed SNS quote cards such as Twitter (X), Instagram, and Bluesky using <blockquote> and then

NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

I think that when I delete the <blockquote> in the editor, it affects the DOM tree, but it does not update the Previewer's React tree accordingly. It seems possible to address this with onChange in MDEditor, but I would like a more fundamental solution. What is the best practice to avoid this error?

ghost avatar Jun 03 '24 15:06 ghost

@skyfoliage Would disabling the script tag solve the issue?

<MDEditor
  previewOptions={{
+    disallowedElements: ['script'],
  }}
/>

jaywcjlove avatar Jul 23 '24 06:07 jaywcjlove

@jaywcjlove Thanks, I'll give it a try :)

ghost avatar Jul 23 '24 06:07 ghost