remy / inliner

Node utility to inline images, CSS and JavaScript for a web page - useful for mobile sites
MIT License
1.1k stars 165 forks source link

inliner.js: urlMatch regexp currently fails on valid CSS image url declarations, proposed fix #20

Closed spacez320 closed 9 years ago

spacez320 commented 11 years ago

Currently if you use spaces before or after the url value in in url declaration in CSS, such as url( "something" ); the function getImagesFromCSS trips up.

Proposed solution (get ready for this) is adjust the urlMatch regexp (inline.js:463) to:

urlMatch = /url\((?:[ '"]*)(?!['"]*data:)(.*?)(?:[ '"]*)\)/g
remy commented 9 years ago

This is (indeed) fixed in 1.0.x (tests included).