Skip to content

Commit 6f41b58

Browse files
refactor: handle escaped absolute paths correctly
1 parent 4f1baa2 commit 6f41b58

File tree

4 files changed

+54
-12
lines changed

4 files changed

+54
-12
lines changed

src/utils.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ function defaultGetLocalIdent(
7373
}
7474

7575
function normalizeUrl(url, isStringValue) {
76-
if (matchNativeWin32Path.test(url)) {
77-
return url;
78-
}
79-
8076
let normalizedUrl = url;
8177

8278
if (isStringValue && /\\[\n]/.test(normalizedUrl)) {
8379
normalizedUrl = normalizedUrl.replace(/\\[\n]/g, '');
8480
}
8581

82+
if (matchNativeWin32Path.test(url)) {
83+
return decodeURIComponent(normalizedUrl);
84+
}
85+
8686
return decodeURIComponent(unescape(normalizedUrl));
8787
}
8888

0 commit comments

Comments
 (0)