From f4140b61e99db2b683af659d1b94a6516a509bbe Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 27 Oct 2024 18:28:51 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/12932 --- app/src/util/pathName.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/util/pathName.ts b/app/src/util/pathName.ts index f3a8f4e51..debe280ea 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) => {