瀏覽代碼

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

Vanessa 8 月之前
父節點
當前提交
c86910e5d6
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/src/util/pathName.ts

+ 1 - 1
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) => {