Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/12060

Vanessa58f72678aed0
diff --git a/app/src/protyle/wysiwyg/list.ts b/app/src/protyle/wysiwyg/list.ts
index c7645a19ce..3ff5beb8e4 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[] = [];