Skip to content

Commit 338e381

Browse files
Fix resolved URLs on Windows.
Previously, when URLs were processed, URLs such as 'a\b\c.png' were generated, despite the backslash not being a valid URL separator. With this change, the escape function also replaces backslash separators in URLs with forward slashes.
1 parent 1703721 commit 338e381

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/url/escape.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ module.exports = function escape(url) {
66
if (/^['"].*['"]$/.test(url)) {
77
url = url.slice(1, -1);
88
}
9+
10+
url = url.replace(/\\/g, '/');
11+
912
// Should url be wrapped?
1013
// See https://drafts.csswg.org/css-values-3/#urls
1114
if (/["'() \t\n]/.test(url)) {

0 commit comments

Comments
 (0)