Vanessa 2025-07-16 10:24:59 +08:00
parent 049b4d4b4b
commit 1629db0fdc

View file

@ -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);