Merge pull request #8904 from streetwriters/editor/fix-heading-plugin

editor: fix crash in heading plugin when pasting markdown content
This commit is contained in:
Abdullah Atta
2025-11-03 10:27:53 +05:00
committed by GitHub

View File

@@ -365,6 +365,8 @@ const headingUpdatePlugin = new Plugin({
newDoc.descendants((newNode, pos) => {
if (newNode.type.name === "heading") {
if (pos >= oldDoc.content.size) return;
const oldNode = oldDoc.nodeAt(pos);
if (
oldNode &&