Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/8403

Vanessa8719a5974f81
diff --git a/app/src/asset/anno.ts b/app/src/asset/anno.ts
index e3639b7d3c..e96d4c9d48 100644
--- a/app/src/asset/anno.ts
+++ b/app/src/asset/anno.ts
@@ -331,8 +331,8 @@ const getHightlightCoordsByRange = (pdf: any, color: string) => {
}
}
});
- const content = Lute.EscapeHTMLStr(rangeContents.textContent);
-
+ // eslint-disable-next-line no-control-regex
+ const content = Lute.EscapeHTMLStr(rangeContents.textContent.replace(/[\x00]|\n/g, ""));
const startPage = pdf.pdfViewer.getPageView(startIndex);
const startPageRect = startPage.canvas.getClientRects()[0];
const startViewport = startPage.viewport;