Skip to content

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

:bug: https://github.com/siyuan-note/siyuan/issues/17355

Vanessafd6720a3063f
diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts
index 748f93b401..5d0d5be289 100644
--- a/app/src/protyle/render/av/cell.ts
+++ b/app/src/protyle/render/av/cell.ts
@@ -796,21 +796,28 @@ export const updateCellsValue = async (protyle: IProtyle, nodeElement: HTMLEleme
if (html) {
const tempElement = document.createElement("template");
tempElement.innerHTML = html;
- tempElement.content.querySelectorAll('[data-type~="a"], .img img').forEach(item => {
- if (item.tagName === "IMG") {
+ tempElement.content.querySelectorAll('[data-type~="a"], .img img').forEach(linkItem => {
+ if (linkItem.tagName === "IMG") {
htmlValue.push({
type: "image",
- content: item.getAttribute("data-src"),
+ content: linkItem.getAttribute("data-src"),
name: ""
});
} else {
htmlValue.push({
type: "file",
- content: item.getAttribute("data-href"),
- name: item.textContent
+ content: linkItem.getAttribute("data-href"),
+ name: linkItem.textContent
});
}
});
+ if (htmlValue.length === 0 && value) {
+ htmlValue.push({
+ type: "file",
+ content: "",
+ name: value
+ });
+ }
}
newValue = oldValue.mAsset.concat(htmlValue);
}