浏览代码

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

Vanessa 9 月之前
父节点
当前提交
9cd86ae309
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/src/ai/actions.ts

+ 2 - 2
app/src/ai/actions.ts

@@ -9,7 +9,7 @@ import {processRender} from "../protyle/util/processCode";
 import {highlightRender} from "../protyle/render/highlightRender";
 import {Constants} from "../constants";
 import {setStorageVal} from "../protyle/util/compatibility";
-import {escapeAriaLabel, escapeHtml} from "../util/escape";
+import {escapeAriaLabel, escapeAttr, escapeHtml} from "../util/escape";
 import {showMessage} from "../dialog/message";
 import {Menu} from "../plugin/Menu";
 import {upDownHint} from "../util/upDownHint";
@@ -166,7 +166,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => {
     });
     let customHTML = "";
     window.siyuan.storage[Constants.LOCAL_AI].forEach((item: { name: string, memo: string }, index: number) => {
-        customHTML += `<div data-action="${item.memo || item.name}" data-index="${index}" class="b3-list-item b3-list-item--narrow ariaLabel" aria-label="${escapeAriaLabel(item.memo)}">
+        customHTML += `<div data-action="${escapeAttr(item.memo || item.name)}" data-index="${index}" class="b3-list-item b3-list-item--narrow ariaLabel" aria-label="${escapeAriaLabel(item.memo)}">
     <span class="b3-list-item__text">${escapeHtml(item.name)}</span>
     <span data-type="edit" class="b3-list-item__action"><svg><use xlink:href="#iconEdit"></use></svg></span>
 </div>`;