Skip to content
This repository was archived by the owner on Apr 30, 2020. It is now read-only.

Commit 8e8ab18

Browse files
fix: handling string urls with backslash and newline (webpack-contrib#1012)
1 parent b59c4f2 commit 8e8ab18

File tree

4 files changed

+22
-769
lines changed

4 files changed

+22
-769
lines changed

src/plugins/postcss-url-parser.js

+4
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ function getUrlsFromValue(value, result, filter, decl) {
8989
if (!isStringNode && /\\["'() \t\n]/.test(normalizedUrl)) {
9090
normalizedUrl = normalizedUrl.replace(/\\(["'() \t\n])/g, '$1');
9191
}
92+
// https://drafts.csswg.org/css-values-4/#strings
93+
else if (isStringNode && /\\[\n]/.test(normalizedUrl)) {
94+
normalizedUrl = normalizedUrl.replace(/\\[\n]/g, '');
95+
}
9296

9397
urls.push({ node, url: normalizedUrl, hash, needQuotes });
9498
});

0 commit comments

Comments
 (0)