Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 删除跨页注释 https://github.com/siyuan-note/siyuan/issues/13282

Vanessa659823011248
diff --git a/app/src/asset/anno.ts b/app/src/asset/anno.ts
index c0f7a721c0..72da912968 100644
--- a/app/src/asset/anno.ts
+++ b/app/src/asset/anno.ts
@@ -197,8 +197,11 @@ export const initAnno = (element: HTMLElement, pdf: any) => {
} else if (type === "remove") {
const urlPath = pdf.appConfig.file.replace(location.origin, "").substr(1);
const config = getConfig(pdf);
- delete config[rectElement.getAttribute("data-node-id")];
- rectElement.remove();
+ const id = rectElement.getAttribute("data-node-id")
+ delete config[id];
+ element.querySelectorAll(`[data-node-id="${id}"]`).forEach(item => {
+ item.remove();
+ });
fetchPost("/api/asset/setFileAnnotation", {
path: urlPath + ".sya",
data: JSON.stringify(config),