An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: https://github.com/siyuan-note/siyuan/issues/17892
Daniel24564c673ba3
diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.tsindex 9f3e3dd2cd..ea62f16c8e 100644--- a/app/src/protyle/wysiwyg/remove.ts+++ b/app/src/protyle/wysiwyg/remove.ts@@ -172,20 +172,20 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang// 删除列表项内容块后,若该列表项仅剩子列表而无内容块,需补一个空段落// 避免"列表项下直接挂列表"的非法结构 https://github.com/siyuan-note/siyuan/issues/17892const liChildren = Array.from(topParentElement.children);- const liSubList = liChildren.find(item => item.classList.contains("list"));- const liHasContent = liChildren.some(item => item.hasAttribute("data-node-id") &&- !item.classList.contains("list") && !item.classList.contains("protyle-action") &&- !item.classList.contains("protyle-attr"));- if (topParentElement.classList.contains("li") && liSubList && !liHasContent) {+ // 首个子块是列表块时,说明列表项下直接挂列表,需补一个空段落作为内容块+ // https://github.com/siyuan-note/siyuan/issues/17892+ const firstBlock = liChildren.find(item => item.hasAttribute("data-node-id") &&+ !item.classList.contains("protyle-action") && !item.classList.contains("protyle-attr"));+ if (topParentElement.classList.contains("li") && firstBlock?.classList.contains("list")) {const emptyID = Lute.NewNodeID();const emptyElement = genEmptyElement(false, false, emptyID);- // 空段落插到列表标记之后、子列表之前,与服务端 doInsert 通过 nextID 定位的位置一致+ // 空段落插到列表标记之后、首个子块之前,与服务端 doInsert 通过 nextID 定位的位置一致liChildren.find(item => item.classList.contains("protyle-action"))?.after(emptyElement);deletes.push({action: "insert",id: emptyID,data: emptyElement.outerHTML,- nextID: liSubList.getAttribute("data-node-id"),+ nextID: firstBlock.getAttribute("data-node-id"),parentID: topParentElement.getAttribute("data-node-id"),});inserts.push({