Vanessa 2024-11-17 10:56:06 +08:00
parent 7c7b73606c
commit 6278c498e8

View file

@ -21,6 +21,7 @@ import {exportImage} from "../protyle/export/util";
import {App} from "../index"; import {App} from "../index";
import {renderAVAttribute} from "../protyle/render/av/blockAttr"; import {renderAVAttribute} from "../protyle/render/av/blockAttr";
import {openAssetNewWindow} from "../window/openNewWindow"; import {openAssetNewWindow} from "../window/openNewWindow";
import {escapeHtml} from "../util/escape";
const bindAttrInput = (inputElement: HTMLInputElement, id: string) => { const bindAttrInput = (inputElement: HTMLInputElement, id: string) => {
inputElement.addEventListener("change", () => { inputElement.addEventListener("change", () => {
@ -326,7 +327,7 @@ export const openFileAttr = (attrs: IObject, focusName = "bookmark", protyle?: I
}); });
btnsElement[1].addEventListener("click", () => { btnsElement[1].addEventListener("click", () => {
if (!isValidAttrName(inputElement.value)) { 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; return false;
} }
target.parentElement.insertAdjacentHTML("beforebegin", `<div class="b3-label b3-label--noborder"> target.parentElement.insertAdjacentHTML("beforebegin", `<div class="b3-label b3-label--noborder">