From 35d0c63928bbcba683ac01472e7984dcbc279d03 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 29 Aug 2022 11:18:05 +0800 Subject: [PATCH] :bug: https://github.com/siyuan-note/siyuan/issues/5746 --- app/src/protyle/wysiwyg/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 335edb4a5..ec7b638b0 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -346,7 +346,8 @@ export class WYSIWYG { } else { if ((headElement.parentElement.childElementCount === 3 && headElement.parentElement.classList.contains("li")) || (headElement.parentElement.childElementCount === 2 && (headElement.parentElement.classList.contains("bq") || headElement.parentElement.classList.contains("sb"))) || - (headElement.parentElement.childElementCount === 1 && headElement.parentElement.classList.contains("protyle-wysiwyg"))) { + (headElement.parentElement.childElementCount === 1 && headElement.parentElement.classList.contains("protyle-wysiwyg")) // 全选剪切标题 + ) { // https://github.com/siyuan-note/siyuan/issues/4040 const emptyId = Lute.NewNodeID(); const emptyElement = genEmptyElement(false, false, emptyId); @@ -354,7 +355,7 @@ export class WYSIWYG { id: emptyId, data: emptyElement.outerHTML, action: "insert", - parentID: headElement.parentElement.getAttribute("data-node-id") + parentID: headElement.parentElement.getAttribute("data-node-id") || protyle.block.parentID }); undoOperations.push({ id: emptyId,