Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/11468

Vanessa5d7c699390db
diff --git a/app/src/protyle/render/av/asset.ts b/app/src/protyle/render/av/asset.ts
index f8e500c9e4..0e74280a94 100644
--- a/app/src/protyle/render/av/asset.ts
+++ b/app/src/protyle/render/av/asset.ts
@@ -61,7 +61,7 @@ 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}</span>`;
+ 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>`;
}
html += `<button class="b3-menu__item" draggable="true" data-index="${index}" data-name="${item.name}" data-type="${item.type}" data-content="${item.content}">
@@ -178,14 +178,14 @@ export const updateAssetCell = (options: {
export const editAssetItem = (options: {
protyle: IProtyle,
cellElements: HTMLElement[],
- blockElement: Element ,
+ blockElement: Element,
content: string,
type: "image" | "file",
name: string,
index: number,
rect: DOMRect
}) => {
- const linkAddress =options.content;
+ const linkAddress = options.content;
const type = options.type as "image" | "file";
const menu = new Menu("av-asset-edit", () => {
if (!textElements[0].value ||
diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts
index 168a8bdef6..9463057e2f 100644
--- a/app/src/protyle/render/av/cell.ts
+++ b/app/src/protyle/render/av/cell.ts
@@ -119,7 +119,7 @@ export const genCellValueByElement = (colType: TAVCol, cellElement: HTMLElement)
mAsset.push({
type: isImg ? "image" : "file",
content: isImg ? item.getAttribute("src") : item.getAttribute("data-url"),
- name: isImg ? "" : item.textContent
+ name: isImg ? "" : item.getAttribute("data-name")
});
});
cellValue.mAsset = mAsset;
@@ -713,7 +713,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-url="${item.content}">${item.name}</span>`;
+ 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>`;
}
});
} else if (cellValue.type === "checkbox") {