From c86910e5d63532c9ba754003cf2abc1484daeb6a Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 30 Oct 2024 22:50:10 +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 debe280ea..2565d3740 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.replace(/-\d{14}-\w{7}/, "").replace(pathPosix().extname(assetPath), "").replace("assets/", ""); + return pathPosix().basename(assetPath, pathPosix().extname(assetPath)).replace(/-\d{14}-\w{7}/, ""); }; export const isLocalPath = (link: string) => {