Skip to content

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

:bug: fix https://github.com/siyuan-note/siyuan/issues/4511

Vanessaa075c7380cc9
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index 693b037416..e8b888cbc8 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -719,7 +719,8 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
});
inputElement.addEventListener("input", (event: KeyboardEvent) => {
if (!event.isComposing) {
- linkElement.innerHTML = Lute.EscapeHTMLStr(inputElement.value) || "";
+ // https://github.com/siyuan-note/siyuan/issues/4511
+ linkElement.innerHTML = Lute.EscapeHTMLStr(inputElement.value.replace(/\\]/g, "]").replace(/\\\[/g, "[")) || "";
}
});
inputElement.addEventListener("keydown", (event) => {