From 43b8224364fbfd00a26a1ca7baced3037c60b6b8 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 30 Dec 2024 09:26:39 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/13617 --- app/src/protyle/wysiwyg/transaction.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index 87d37f6e6..1948b2497 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 嵌入块