From e1b747b45abf1052d1a0ca07a31b9515e283769d Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 12 May 2025 11:10:29 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/14797 --- app/src/protyle/wysiwyg/transaction.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index 91eba5ba3..c228d85c2 100644 --- a/app/src/protyle/wysiwyg/transaction.ts +++ b/app/src/protyle/wysiwyg/transaction.ts @@ -621,14 +621,15 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo: }, 450); } }); + const attrElement = item.querySelector(".protyle-attr") if (data.new["custom-avs"] && !data.new["av-names"]) { - nodeAttrHTML += item.lastElementChild.querySelector(".protyle-attr--av")?.outerHTML || ""; + nodeAttrHTML += attrElement.querySelector(".protyle-attr--av")?.outerHTML || ""; } - const refElement = item.lastElementChild.querySelector(".protyle-attr--refcount"); + const refElement = attrElement.querySelector(".protyle-attr--refcount"); if (refElement) { nodeAttrHTML += refElement.outerHTML; } - item.lastElementChild.innerHTML = nodeAttrHTML + Constants.ZWSP; + attrElement.innerHTML = nodeAttrHTML + Constants.ZWSP; }); return; }