From 1629db0fdcc30a4a1737e47673d9d8b5949adc89 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 16 Jul 2025 10:24:59 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/15301 --- app/src/protyle/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.ts index 56520e4e2..e481569db 100644 --- a/app/src/protyle/index.ts +++ b/app/src/protyle/index.ts @@ -177,7 +177,8 @@ export class Protyle { } else { onTransaction(this.protyle, item, false); // 反链面板移除元素后,文档为空 - if (this.protyle.wysiwyg.element.childElementCount === 0 && this.protyle.block.parentID) { + if (this.protyle.wysiwyg.element.childElementCount === 0 && this.protyle.block.parentID && + !(item.action === "delete" && typeof item.data?.createEmptyParagraph === "boolean" && !item.data.createEmptyParagraph)) { const newID = Lute.NewNodeID(); const emptyElement = genEmptyElement(false, false, newID); this.protyle.wysiwyg.element.append(emptyElement);