From cde0840bf7799670d080c712ba967b47505339ed Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 29 Dec 2025 22:08:07 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/12327 --- app/src/protyle/wysiwyg/remove.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.ts index 1fc12776d..30b98ffcc 100644 --- a/app/src/protyle/wysiwyg/remove.ts +++ b/app/src/protyle/wysiwyg/remove.ts @@ -511,6 +511,14 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang // 图片前删除到上一个文字块时,图片前有 zwsp previousLastElement.outerHTML = protyle.lute.SpinBlockDOM(previousLastElement.outerHTML); mathRender(getPreviousBlock(removeElement) as HTMLElement); + const removeParentElement = removeElement.parentElement; + // https://github.com/siyuan-note/siyuan/issues/12327 + if (removeParentElement.classList.contains("li") && removeParentElement.childElementCount === 4 && + removeParentElement.getAttribute("fold") === "1") { + const foldOperations = setFold(protyle, removeParentElement, true, false, false, true); + doOperations.push(...foldOperations.doOperations); + undoOperations.splice(0, 0, ...foldOperations.undoOperations); + } removeElement.remove(); // extractContents 内容过多时需要进行滚动条重置,否则位置会错位 protyle.contentElement.scrollTop = scroll;