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/7134

Vanessaa5dcf0827f5b
diff --git a/app/src/protyle/preview/image.ts b/app/src/protyle/preview/image.ts
index 6b95b57a1a..dbd079b010 100644
--- a/app/src/protyle/preview/image.ts
+++ b/app/src/protyle/preview/image.ts
@@ -19,6 +19,14 @@ export const previewImage = (src: string, id: string) => {
imagesElement.innerHTML = html;
// @ts-ignore
const viewer = new Viewer(imagesElement, {
+ title: [1, (image: HTMLImageElement, imageData: IObject) => {
+ let name = image.alt;
+ if (!name) {
+ name = image.src.substring(image.src.lastIndexOf("/") + 1);
+ }
+ name = name.substring(0, name.lastIndexOf(".")).replace(/-\d{14}-\w{7}$/, "");
+ return `${name} [${imageData.naturalWidth} × ${imageData.naturalHeight}]`;
+ }],
button: false,
initialViewIndex,
transition: false,