editor: fix crash in heading plugin when pasting markdown content

Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
01zulfi
2025-11-03 09:01:09 +05:00
parent 36c8b8cc25
commit 38daca0099

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 &&