// strip parentheses in urls if possible (no spaces inside)
replace(/url\((['"])([^\)]+)['"]\)/g, function(match, quote, url) {
- if (url.match(/[ \t]/g) !== null)
+ if (url.match(/[ \t]/g) !== null || url.indexOf('data:') === 0)
return 'url(' + quote + url + quote + ')';
else
return 'url(' + url + ')';
}),
'urls': cssContext({
'keep urls without parentheses unchanged': 'a{background:url(/images/blank.png) 0 0 no-repeat}',
+ 'keep urls with data URI unchanged': ".icon-logo{background-image:url('data:image/svg+xml;charset=US-ASCII')}",
'strip single parentheses': [
"a{background:url('/images/blank.png') 0 0 no-repeat}",
"a{background:url(/images/blank.png) 0 0 no-repeat}"