Skip to content

Commit

Permalink
#1621 fix: correct escaping of backslashes in URL wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchira-net committed Nov 22, 2024
1 parent 9cf9cd8 commit 0d0e829
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/getUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = (url, options) => {
// Should url be wrapped?
// See https://drafts.csswg.org/css-values-3/#urls
if (/["'() \t\n]|(%20)/.test(url) || options.needQuotes) {
return `"${url.replace(/"/g, '\\"').replace(/\n/g, "\\n")}"`;
return `"${url.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, "\\n')}"`;
}

return url;
Expand Down

0 comments on commit 0d0e829

Please sign in to comment.