Issue Description
While using ProseMirror, I’ve noticed that setting definingAsContext: false
on blockquote nodes doesn’t seem to work as described in the documentation. According to the docs, non-defining nodes should be dropped when their entire content is replaced, but in my testing, the blockquote node is still preserved after completely replacing its content.
Environment Information
- ProseMirror version: GitHub - ProseMirror/prosemirror: The ProseMirror WYSIWYM editor
Code Configuration
Here’s my blockquote node specification:
blockquote: {
content: "block+",
group: "block",
definingAsContext: false,
parseDOM: [{tag: "blockquote"}],
toDOM() { return blockquoteDOM }
} as NodeSpec
Steps to Reproduce
- Create a document with a blockquote
- Add paragraph text inside the blockquote
- Select all content inside the blockquote
- Copy some text from an external source (like Notepad)
- Paste into the selected blockquote content
Expected Behavior
According to the documentation, since definingAsContext
is set to false
, when the blockquote content is completely replaced, the blockquote node itself should be dropped, and the pasted content should become a regular paragraph.
Actual Behavior
The blockquote node remains unchanged, and the pasted content is still wrapped in the blockquote.
Question
Is this a misunderstanding of how the definingAsContext
property works, or is this behavior not as expected? Are there other factors affecting this behavior?
Thank you for your help!