uiwjs / uiwjs/react-md-editor

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

Open
#646 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.9k
Forks
201
Avg merge
12m
Merged PRs (30d)
1

Description

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 <script> in the editor. The preview was able to show these cards, but when I deleted the <blockquote> tag above the <script>, an error occurred.

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by embedding an SNS quote card with a blockquote and script, then deleting the blockquote above the script in the editor. Inspect how the preview DOM and React tree are updated during deletion; done means the preview no longer throws the NotFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.