Merge pull request #500 from Stapxs/patch-1

fix: 在处理 file uri 时可能会意外忽略 fragment 段
This commit is contained in:
手瓜一十雪
2024-11-07 16:13:06 +08:00
committed by GitHub

View File

@@ -215,7 +215,7 @@ export async function checkUriType(Uri: string) {
}
if (uri.startsWith('file://')) {
let filePath: string;
const pathname = decodeURIComponent(new URL(uri).pathname);
const pathname = decodeURIComponent(new URL(uri).pathname + new URL(uri).hash);
if (process.platform === 'win32') {
filePath = pathname.slice(1);
} else {