From a13462a52a1f7ad3a7a6fd80ac1ddfdbdcac1eff Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 23 Feb 2025 17:37:32 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/14114 --- app/src/protyle/util/insertHTML.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.ts index ad013c53f..234ffb0de 100644 --- a/app/src/protyle/util/insertHTML.ts +++ b/app/src/protyle/util/insertHTML.ts @@ -382,7 +382,7 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false, const tempElement = document.createElement("template"); // https://github.com/siyuan-note/siyuan/issues/14162 - if (html.startsWith(">") && editableElement.textContent.replace(Constants.ZWSP, "") !== "" ) { + if (html.startsWith(">") && editableElement.textContent.replace(Constants.ZWSP, "") !== "") { unSpinHTML = html; } @@ -395,7 +395,8 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false, // https://github.com/siyuan-note/siyuan/issues/14114 let heading2text = false; - if (isBlock && editableElement.textContent.replace(Constants.ZWSP, "") !== "" && tempElement.content.childElementCount === 1 && + if (isBlock && (editableElement.textContent.replace(Constants.ZWSP, "") !== "" || blockElement.getAttribute("data-type") === "NodeHeading") && + tempElement.content.childElementCount === 1 && tempElement.content.firstChild.nodeType !== 3 && tempElement.content.firstElementChild.getAttribute("data-type") === "NodeHeading") { isBlock = false;