From 1278e1142a1432aee16b8f1724e22e78a8ebdd42 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 23 Mar 2025 18:44:35 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/14326 --- app/src/protyle/wysiwyg/transaction.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index b7265a889..19705ec0b 100644 --- a/app/src/protyle/wysiwyg/transaction.ts +++ b/app/src/protyle/wysiwyg/transaction.ts @@ -481,6 +481,12 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo: updateElements.push(newUpdateElement); operation.data = newTempElement.outerHTML; operation.id = newUpdateId; + // https://github.com/siyuan-note/siyuan/issues/14326#issuecomment-2746140335 + protyle.wysiwyg.element.childNodes.forEach((item, index) => { + if (index !== 0) { + item.remove(); + } + }) } } if (updateElements.length > 0) {