diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index 7801c9e8d..3e683bb22 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -47,6 +47,7 @@ import {linkMenu} from "../../menus/protyle"; import {addScript} from "../util/addScript"; import {confirmDialog} from "../../dialog/confirmDialog"; import {pasteAsPlainText, pasteEscaped, pasteText} from "../util/paste"; +import {escapeHtml} from "../../util/escape"; export class Toolbar { public element: HTMLElement; @@ -1283,7 +1284,7 @@ export class Toolbar { html += `
${item.replace(lowerCaseValue, "" + lowerCaseValue + "")}
`; }); if (inputElement.value.trim() && !matchInput) { - html = `
${inputElement.value.replace(/`| /g, "_")}
${html}`; + html = `
${escapeHtml(inputElement.value.replace(/`| /g, "_"))}
${html}`; } html = `
${window.siyuan.languages.clear}
` + html; listElement.innerHTML = html;