diff --git a/lib/css.js b/lib/css.js index ca669a0..ab40eca 100644 --- a/lib/css.js +++ b/lib/css.js @@ -11,6 +11,11 @@ var parse = require('path').parse; function getImages(root, css) { var inliner = this; + + if (inliner.options.images === false) { + return css; + } + var singleURLMatch = /url\(\s*(['"]*)(?!['"]*data:)(.*?)(['"]*)\s*\)/; var matches = css.match(match) || []; var images = matches.map(function eachURL(url) { diff --git a/test/fixtures/bg-img-no-inline.opts.json b/test/fixtures/bg-img-no-inline.opts.json new file mode 100644 index 0000000..5050cdf --- /dev/null +++ b/test/fixtures/bg-img-no-inline.opts.json @@ -0,0 +1,3 @@ +{ + "images": false +} diff --git a/test/fixtures/bg-img-no-inline.result.html b/test/fixtures/bg-img-no-inline.result.html new file mode 100644 index 0000000..ceee736 --- /dev/null +++ b/test/fixtures/bg-img-no-inline.result.html @@ -0,0 +1 @@ + diff --git a/test/fixtures/bg-img-no-inline.src.html b/test/fixtures/bg-img-no-inline.src.html new file mode 100644 index 0000000..fed7bbb --- /dev/null +++ b/test/fixtures/bg-img-no-inline.src.html @@ -0,0 +1,7 @@ + + +