From 8ea8db64ec008d69e62af362295d96ef2f466450 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 18 Sep 2025 19:56:53 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/15873 --- app/src/protyle/util/editorCommonEvent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 264b5769e..2f4aedc1c 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -177,11 +177,11 @@ const moveTo = async (protyle: IProtyle, sourceElements: Element[], targetElemen if (position === "afterend" && targetElement.getAttribute("data-type") === "NodeHeading" && targetElement.getAttribute("fold") === "1") { - ignoreInsert = targetElement.getAttribute("data-subtype").replace("h", ""); + ignoreInsert = targetElement.getAttribute("data-subtype")?.replace("h", ""); } else if (position === "beforebegin" && targetElement.previousElementSibling && targetElement.previousElementSibling.getAttribute("data-type") === "NodeHeading" && targetElement.previousElementSibling.getAttribute("fold") === "1") { - ignoreInsert = targetElement.getAttribute("data-subtype").replace("h", ""); + ignoreInsert = targetElement.getAttribute("data-subtype")?.replace("h", ""); } if (ignoreInsert) { let breakIgnore = false;