Skip to content

Commit

Permalink
refactor: handle escaped absolute paths correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Jul 29, 2020
1 parent 4f1baa2 commit 6f41b58
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ function defaultGetLocalIdent(
}

function normalizeUrl(url, isStringValue) {
if (matchNativeWin32Path.test(url)) {
return url;
}

let normalizedUrl = url;

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

if (matchNativeWin32Path.test(url)) {
return decodeURIComponent(normalizedUrl);
}

return decodeURIComponent(unescape(normalizedUrl));
}

Expand Down
Loading

0 comments on commit 6f41b58

Please sign in to comment.