Skip to content

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

:bug: 引用锚文本转义

Vanessae3d0573b5a19
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index 106ec068f7..48cd4557f0 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -73,7 +73,8 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
});
inputElement.addEventListener("input", () => {
if (inputElement.value) {
- element.textContent = Lute.EscapeHTMLStr(inputElement.value);
+ // 不能使用 textContent,否则 < 会变为 &lt;
+ element.innerHTML = Lute.EscapeHTMLStr(inputElement.value);
} else {
fetchPost("/api/block/getRefText", {id: refBlockId}, (response) => {
element.innerHTML = response.data;