From d275f20a4dae98faeb8aeefac0a0489f5b0b3178 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 7 Apr 2025 10:22:19 +0800 Subject: [PATCH] :bug: https://github.com/siyuan-note/siyuan/issues/14510 --- app/src/protyle/wysiwyg/commonHotkey.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/protyle/wysiwyg/commonHotkey.ts b/app/src/protyle/wysiwyg/commonHotkey.ts index 983a2bec3..e538140d2 100644 --- a/app/src/protyle/wysiwyg/commonHotkey.ts +++ b/app/src/protyle/wysiwyg/commonHotkey.ts @@ -266,17 +266,17 @@ export const duplicateBlock = (nodeElements: Element[], protyle: IProtyle) => { } const newId = Lute.NewNodeID(); tempElement.setAttribute("data-node-id", newId); - tempElement.setAttribute("data-node-id", newId); tempElement.removeAttribute(Constants.CUSTOM_RIFF_DECKS); tempElement.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl"); tempElement.setAttribute("updated", newId.split("-")[0]); tempElement.removeAttribute("refcount"); tempElement.lastElementChild.querySelector(".protyle-attr--refcount")?.remove(); tempElement.querySelectorAll("[data-node-id]").forEach(childItem => { - childItem.setAttribute("data-node-id", newId); + const subNewId = Lute.NewNodeID(); + childItem.setAttribute("data-node-id", subNewId); childItem.removeAttribute(Constants.CUSTOM_RIFF_DECKS); childItem.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl"); - childItem.setAttribute("updated", newId.split("-")[0]); + childItem.setAttribute("updated", subNewId.split("-")[0]); childItem.removeAttribute("refcount"); childItem.lastElementChild.querySelector(".protyle-attr--refcount")?.remove(); });