An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: fix https://github.com/siyuan-note/siyuan/issues/11463
Vanessa44d57d0c34fa
diff --git a/app/src/protyle/render/av/asset.ts b/app/src/protyle/render/av/asset.tsindex e0095e9453..1de4356787 100644--- a/app/src/protyle/render/av/asset.ts+++ b/app/src/protyle/render/av/asset.ts@@ -16,6 +16,7 @@ import {fetchPost} from "../../../util/fetch";import {hasClosestBlock, hasClosestByClassName} from "../../util/hasClosest";import {genCellValueByElement, getTypeByCellElement} from "./cell";import {writeText} from "../../util/compatibility";+import {escapeAttr} from "../../../util/escape";export const bindAssetEvent = (options: {protyle: IProtyle,@@ -58,10 +59,10 @@ export const getAssetHTML = (cellElements: HTMLElement[]) => {<img style="max-height: 180px;max-width: 360px;border-radius: var(--b3-border-radius);margin: 4px 0;" src="${item.content}"/></span>`;} else {- contentHTML = `<span data-type="openAssetItem" class="fn__ellipsis b3-menu__label ariaLabel" aria-label="${item.content}" style="max-width: 360px">${item.name || item.content}</span>`;+ contentHTML = `<span data-type="openAssetItem" class="fn__ellipsis b3-menu__label ariaLabel" aria-label="${escapeAttr(item.content)}" style="max-width: 360px">${item.name || item.content}</span>`;}- html += `<button class="b3-menu__item" draggable="true" data-index="${index}" data-name="${item.name}" data-type="${item.type}" data-content="${item.content}">+ html += `<button class="b3-menu__item" draggable="true" data-index="${index}" data-name="${escapeAttr(item.name)}" data-type="${item.type}" data-content="${escapeAttr(item.content)}"><svg class="b3-menu__icon fn__grab"><use xlink:href="#iconDrag"></use></svg>${contentHTML}<svg class="b3-menu__action" data-type="editAssetItem"><use xlink:href="#iconEdit"></use></svg>diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex 1e78af6f28..2c316dfdd8 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -14,6 +14,7 @@ import {Constants} from "../../../constants";import {hintRef} from "../../hint/extend";import {pathPosix} from "../../../util/pathName";import {mergeAddOption} from "./select";+import {escapeAttr} from "../../../util/escape";const renderCellURL = (urlContent: string) => {let host = urlContent;@@ -730,7 +731,7 @@ export const renderCell = (cellValue: IAVCellValue, rowIndex = 0) => {if (item.type === "image") {text += `<img class="av__cellassetimg ariaLabel" aria-label="${item.content}" src="${item.content}">`;} else {- text += `<span class="b3-chip av__celltext--url ariaLabel" aria-label="${item.content}" data-name="${item.name}" data-url="${item.content}">${item.name || item.content}</span>`;+ text += `<span class="b3-chip av__celltext--url ariaLabel" aria-label="${escapeAttr(item.content)}" data-name="${escapeAttr(item.name)}" data-url="${escapeAttr(item.content)}">${item.name || item.content}</span>`;}});} else if (cellValue.type === "checkbox") {