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/13617

Vanessa43b8224364fb
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 87d37f6e60..1948b24977 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -277,10 +277,15 @@ const deleteBlock = (updateElements: Element[], id: string, protyle: IProtyle, i
focusSideBlock(updateElements[0]);
}
updateElements.forEach(item => {
- // 需移除顶层,否则删除唯一的列表项后列表无法清除干净 https://github.com/siyuan-note/siyuan/issues/12326 第一点
- const topElement = getTopAloneElement(item);
- if (topElement) {
- topElement.remove();
+ if (isUndo) {
+ // https://github.com/siyuan-note/siyuan/issues/13617
+ item.remove();
+ } else {
+ // 需移除顶层,否则删除唯一的列表项后列表无法清除干净 https://github.com/siyuan-note/siyuan/issues/12326 第一点
+ const topElement = getTopAloneElement(item);
+ if (topElement) {
+ topElement.remove();
+ }
}
});
// 更新 ws 嵌入块