Skip to content

Commit 0d0e829

Browse files
committed
#1621 fix: correct escaping of backslashes in URL wrapping
1 parent 9cf9cd8 commit 0d0e829

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/runtime/getUrl.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = (url, options) => {
2121
// Should url be wrapped?
2222
// See https://drafts.csswg.org/css-values-3/#urls
2323
if (/["'() \t\n]|(%20)/.test(url) || options.needQuotes) {
24-
return `"${url.replace(/"/g, '\\"').replace(/\n/g, "\\n")}"`;
24+
return `"${url.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, "\\n')}"`;
2525
}
2626

2727
return url;

0 commit comments

Comments
 (0)