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/13169

Vanessa6278c498e8c8
diff --git a/app/src/menus/commonMenuItem.ts b/app/src/menus/commonMenuItem.ts
index 0c76741146..68aa6e58e2 100644
--- a/app/src/menus/commonMenuItem.ts
+++ b/app/src/menus/commonMenuItem.ts
@@ -21,6 +21,7 @@ import {exportImage} from "../protyle/export/util";
import {App} from "../index";
import {renderAVAttribute} from "../protyle/render/av/blockAttr";
import {openAssetNewWindow} from "../window/openNewWindow";
+import {escapeHtml} from "../util/escape";
const bindAttrInput = (inputElement: HTMLInputElement, id: string) => {
inputElement.addEventListener("change", () => {
@@ -326,7 +327,7 @@ export const openFileAttr = (attrs: IObject, focusName = "bookmark", protyle?: I
});
btnsElement[1].addEventListener("click", () => {
if (!isValidAttrName(inputElement.value)) {
- showMessage(window.siyuan.languages.attrName + " <b>" + inputElement.value + "</b> " + window.siyuan.languages.invalid);
+ showMessage(window.siyuan.languages.attrName + " <b>" + escapeHtml(inputElement.value) + "</b> " + window.siyuan.languages.invalid);
return false;
}
target.parentElement.insertAdjacentHTML("beforebegin", `<div class="b3-label b3-label--noborder">