From 5abce8710b5d3988666c015fdc4c9685919debde Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 9 Jan 2025 18:07:31 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/13764 --- app/src/protyle/wysiwyg/remove.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.ts index 4aa421656..68f1aa6d7 100644 --- a/app/src/protyle/wysiwyg/remove.ts +++ b/app/src/protyle/wysiwyg/remove.ts @@ -9,7 +9,7 @@ import { hasNextSibling, hasPreviousSibling } from "./getBlock"; -import {transaction, turnsIntoTransaction, updateTransaction} from "./transaction"; +import {transaction, turnsIntoOneTransaction, turnsIntoTransaction, updateTransaction} from "./transaction"; import {cancelSB, genEmptyElement} from "../../block/util"; import {listOutdent, updateListOrder} from "./list"; import {setFold, zoomOut} from "../../menus/protyle"; @@ -543,6 +543,24 @@ const removeLi = (protyle: IProtyle, blockElement: Element, range: Range, isDele id: listElement.getAttribute("data-node-id"), }); transaction(protyle, doOperations, undoOperations); + if (listElement.parentElement.classList.contains("sb") && + listElement.parentElement.getAttribute("data-sb-layout") === "col") { + const selectsElement: Element[] = [] + let previousElement: Element = listElement; + while (previousElement) { + selectsElement.push(previousElement); + if (undoOperations[0].id === previousElement.getAttribute("data-node-id")) { + break; + } + previousElement = previousElement.previousElementSibling; + } + turnsIntoOneTransaction({ + protyle, + selectsElement: selectsElement.reverse(), + type: "BlocksMergeSuperBlock", + level: "row" + }); + } focusByWbr(protyle.wysiwyg.element, range); return; }