diff --git a/gulp-make-css-url-version/index.js b/gulp-make-css-url-version/index.js index be48142..c26ae79 100644 --- a/gulp-make-css-url-version/index.js +++ b/gulp-make-css-url-version/index.js @@ -67,12 +67,12 @@ module.exports = function (options) { var promises = []; - html = html.replace(/url\("?([^\)"]+)"?\)/g, function (str, url) { + html = html.replace(/url\(["|']?([^\)#"']+)["|']?\)/g, function (str, url) { url = url.replace(/\?[\s\S]*$/, "").trim(); url = url.replace(/['"]*/g, ""); - if (url.indexOf("base64,") > -1 || url.indexOf("about:blank") > -1 || url.indexOf("http://") > -1 || url === '/') { + if (url.indexOf("base64,") > -1 || url.indexOf("about:blank") > -1 || url.indexOf("http://") > -1 || url === '/' || url === '') { return str; }