Skip to content

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

:bug: Render image names and tooltip text immediately after insertion https://github.com/siyuan-note/siyuan/issues/19999

Daniela42abdb021d4
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index c525fb108e..447cd13140 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -2494,7 +2494,8 @@ export const transaction = (protyle: IProtyle, doOperations: IOperation[], undoO
}
// 本地插入和正在编辑的块保留现有 DOM,立即补充图片文件名和提示文本。
doOperations.forEach(operation => {
- if ((operation.action === "insert" || operation.action === "update") && operation.data.includes("<img ")) {
+ if ((operation.action === "insert" || operation.action === "update") &&
+ typeof operation.data === "string" && operation.data.includes("<img ")) {
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach(renderImageDisplay);
}
});