Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/15301

Vanessa1629db0fdcc3
diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.ts
index 56520e4e27..e481569dba 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);