diff --git a/README.md b/README.md index 14edfd8..c79493c 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ passed into `grunt.initConfig()`. grunt.initConfig({ inlinecss: { main: { + codeBlocks: { + }, options: { }, files: { @@ -49,6 +51,9 @@ grunt.initConfig({ You can see available options [here](https://github.com/Automattic/juice/tree/v4.1.0#options) +You can see how to use `codeBlocks` +[here](https://github.com/Automattic/juice/tree/v4.1.0#juicecodeblocks) + ## The "inlinecontent" task ### Overview diff --git a/tasks/inline_css.js b/tasks/inline_css.js index 45bf113..38fe5de 100644 --- a/tasks/inline_css.js +++ b/tasks/inline_css.js @@ -18,10 +18,13 @@ module.exports = function(grunt) { grunt.registerMultiTask('inlinecss', 'Takes an html file with linked css files or separate css files and turns inline. Great for emails.', function() { // Merge task-specific and/or target-specific options with these defaults. const options = this.options(); + const codeBlocks = this.data.codeBlocks; const done = this.async(); let index = 0; const count = this.files.length; + juice.codeBlocks = Object.assign({}, juice.codeBlocks, codeBlocks); + const increaseCount = function () { index++; if (index === count) {