From 58f72678aed036ad1bfa2bbd31a877daffeb6b58 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 23 Sep 2025 23:17:52 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/12060 --- app/src/protyle/wysiwyg/list.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/list.ts b/app/src/protyle/wysiwyg/list.ts index c7645a19c..3ff5beb8e 100644 --- a/app/src/protyle/wysiwyg/list.ts +++ b/app/src/protyle/wysiwyg/list.ts @@ -3,7 +3,7 @@ import {transaction, turnsIntoOneTransaction, updateTransaction} from "./transac import {genEmptyBlock} from "../../block/util"; import * as dayjs from "dayjs"; import {Constants} from "../../constants"; -import {moveToPrevious} from "./remove"; +import {moveToPrevious, removeBlock} from "./remove"; import {hasClosestByClassName} from "../util/hasClosest"; import {setFold} from "../../menus/protyle"; @@ -219,6 +219,10 @@ export const listIndent = (protyle: IProtyle, liItemElements: Element[], range: export const breakList = (protyle: IProtyle, blockElement: Element, range: Range) => { const listItemElement = blockElement.parentElement; + if (!listItemElement.previousElementSibling) { + removeBlock(protyle, blockElement, range, "Backspace"); + return; + } const listItemId = listItemElement.getAttribute("data-node-id"); const doOperations: IOperation[] = []; const undoOperations: IOperation[] = [];