From 4abc67c046f5eb96f2b287af98b11b9ad2ca01f9 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 12 Jan 2025 11:32:31 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/13791 --- app/src/dialog/processSystem.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts index 06fb3211912..b67692d58bb 100644 --- a/app/src/dialog/processSystem.ts +++ b/app/src/dialog/processSystem.ts @@ -170,9 +170,10 @@ export const setDefRefCount = (data: { "rootRefCount": number, "rootID": string refIDs: string[] + rootRefIDs: string[] }) => { getAllEditor().forEach(editor => { - if (data.rootID === data.blockID && editor.protyle.block.rootID === data.rootID) { + if (editor.protyle.block.rootID === data.rootID) { if (!editor.protyle.title) { return; } @@ -183,13 +184,16 @@ export const setDefRefCount = (data: { countElement.remove(); } else { countElement.textContent = data.rootRefCount.toString(); - countElement.setAttribute("data-id", JSON.stringify(data.refIDs)); + countElement.setAttribute("data-id", JSON.stringify(data.rootRefIDs)); } } else if (data.rootRefCount > 0) { - attrElement.insertAdjacentHTML("beforeend", `
${data.rootRefCount}
`); + attrElement.insertAdjacentHTML("beforeend", `
${data.rootRefCount}
`); } return; } + if (data.rootID === data.blockID) { + return; + } // 不能对比 rootId,否则嵌入块中的锚文本无法更新 editor.protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${data.blockID}"]`).forEach(item => { // 不能直接查询,否则列表中会获取到第一个列表项的 attr https://github.com/siyuan-note/siyuan/issues/12738