Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/12932

Vanessaf4140b61e99d
diff --git a/app/src/util/pathName.ts b/app/src/util/pathName.ts
index f3a8f4e51b..debe280eac 100644
--- a/app/src/util/pathName.ts
+++ b/app/src/util/pathName.ts
@@ -80,7 +80,7 @@ export const getDisplayName = (filePath: string, basename = true, removeSY = fal
};
export const getAssetName = (assetPath: string) => {
- return assetPath.substring(7, assetPath.length - pathPosix().extname(assetPath).length - 23);
+ return assetPath.replace(/-\d{14}-\w{7}/, "").replace(pathPosix().extname(assetPath), "").replace("assets/", "");
};
export const isLocalPath = (link: string) => {