Skip to content
Snippets Groups Projects
Commit 58456b85 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

Merge pull request #1654 from mozilla/issue_1652_compress_mult_backgrounds

Fix not being able to have multiple background images per CSS declaration.
parents 397dbe65 3d22b939
No related branches found
No related tags found
No related merge requests found
......@@ -89,7 +89,9 @@ function compressResource(staticPath, name, files, cb) {
}
function cachify_embedded (css_src) {
return css_src.replace(/url\s*\(['"](.*)\s*['"]\s*\)/g, function (str, url) {
// RegExp is set up to handle multiple url's per declaration, which is
// possible for things like background-images.
return css_src.replace(/url\s*\(['"]([^\)'"]+)\s*['"]\s*\)/g, function (str, url) {
// This will throw an error if url doesn't exist. This is good as we will
// catch typos during build.
logger.info("For " + str + " making " + url + " into " + cachify.cachify(url));
......@@ -107,4 +109,4 @@ process.on('message', function(m) {
info: info
});
});
});
\ No newline at end of file
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment