diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.ts index 396c780da..99439e2e1 100644 --- a/app/src/protyle/util/insertHTML.ts +++ b/app/src/protyle/util/insertHTML.ts @@ -555,4 +555,8 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false, wbrElement.remove(); } transaction(protyle, doOperation, undoOperation); + // 复制容器块中包含折叠标题块 + protyle.wysiwyg.element.querySelectorAll("[parent-heading]").forEach(item => { + item.remove(); + }); }; diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index 4d4f0541d..eb3074972 100644 --- a/app/src/protyle/wysiwyg/transaction.ts +++ b/app/src/protyle/wysiwyg/transaction.ts @@ -242,6 +242,9 @@ const promiseTransaction = () => { // blockRender(protyle, item); // } // }); + protyle.wysiwyg.element.querySelectorAll("[parent-heading]").forEach(item => { + item.remove(); + }); } }); @@ -852,6 +855,9 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo: wbrElement.remove(); } }); + protyle.wysiwyg.element.querySelectorAll("[parent-heading]").forEach(item => { + item.remove(); + }); return; } if (operation.action === "append") {