Vanessa 2025-08-01 22:49:04 +08:00
parent 61bc821754
commit 381a7b88ff
2 changed files with 11 additions and 5 deletions

View file

@ -179,11 +179,15 @@ export class Protyle {
if (this.protyle.wysiwyg.element.childElementCount === 0 && this.protyle.block.parentID &&
!(item.action === "delete" && typeof item.data?.createEmptyParagraph === "boolean" && !item.data.createEmptyParagraph)) {
if (item.action === "delete" && this.protyle.block.showAll) {
zoomOut({
protyle: this.protyle,
id: this.protyle.block.rootID,
focusId: this.protyle.block.id
});
if (this.protyle.options.handleEmptyContent) {
this.protyle.options.handleEmptyContent();
} else {
zoomOut({
protyle: this.protyle,
id: this.protyle.block.rootID,
focusId: this.protyle.block.id
});
}
} else {
const newID = Lute.NewNodeID();
const emptyElement = genEmptyElement(false, false, newID);

View file

@ -483,6 +483,8 @@ interface IProtyleOptions {
preventInsetEmptyBlock?: boolean
}
handleEmptyContent?(): void
/** 编辑器异步渲染完成后的回调方法 */
after?(protyle: import("../protyle").Protyle): void;
}