Skip to content

Commit 4b45751

Browse files
authored
Merge pull request #237 from cnblogs/fix-getfilepath
fix: get file path from post-file map
2 parents 674c8d3 + 47040a8 commit 4b45751

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/service/post/post-file-map.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ export namespace PostFileMapManager {
6767
export function getFilePath(postId: number) {
6868
const map = findByPostId(postId)
6969
if (map === undefined) return
70-
if (map[1] === '') return
71-
return map[1]
70+
const path = map[1]
71+
if (path === '') return
72+
return path.startsWith('/') ? Uri.parse(path).fsPath : path
7273
}
7374

7475
export function getPostId(filePath: string) {

0 commit comments

Comments
 (0)