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

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