From db31c47760db6d1c7604d965c2db289b6bc044cc Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 4 Oct 2025 10:39:48 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20https://github.com/siyuan-note/siyuan/i?= =?UTF-8?q?ssues/15989=20=E6=A0=87=E9=A2=98=E5=89=8D=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=9C=80=E5=B1=95=E5=BC=80=E7=9B=B8=E5=85=B3=E6=8A=98=E5=8F=A0?= =?UTF-8?q?=E7=9A=84=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/wysiwyg/remove.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.ts index f71ea5d62..4f8719346 100644 --- a/app/src/protyle/wysiwyg/remove.ts +++ b/app/src/protyle/wysiwyg/remove.ts @@ -12,7 +12,7 @@ import { import {transaction, turnsIntoOneTransaction, turnsIntoTransaction, updateTransaction} from "./transaction"; import {cancelSB, genEmptyElement} from "../../block/util"; import {listOutdent, updateListOrder} from "./list"; -import {zoomOut} from "../../menus/protyle"; +import {setFold, zoomOut} from "../../menus/protyle"; import {preventScroll} from "../scroll/preventScroll"; import {hideElements} from "../ui/hideElements"; import {Constants} from "../../constants"; @@ -300,13 +300,14 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang return; } if (blockType === "NodeHeading") { - if ((blockElement.previousElementSibling && - blockElement.previousElementSibling.getAttribute("data-type") === "NodeHeading" && - blockElement.previousElementSibling.getAttribute("fold") === "1") || - (blockElement.getAttribute("data-type") === "NodeHeading" && - blockElement.getAttribute("fold") === "1")) { - focusBlock(blockElement.previousElementSibling, undefined, false); - return; + if (blockElement.previousElementSibling && + blockElement.previousElementSibling.getAttribute("data-type") === "NodeHeading" && + blockElement.previousElementSibling.getAttribute("fold") === "1") { + setFold(protyle, blockElement.previousElementSibling, true, false, false); + } + if (blockElement.getAttribute("data-type") === "NodeHeading" && + blockElement.getAttribute("fold") === "1") { + setFold(protyle, blockElement, true, false, false); } turnsIntoTransaction({ protyle: protyle,