diff --git a/README.md b/README.md index ad63930..7c78e82 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ In your project's Gruntfile, add a section named `inlinecss` to the data object grunt.initConfig({ inlinecss: { main: { + codeBlocks: { + }, options: { }, files: { @@ -38,7 +40,7 @@ grunt.initConfig({ }) ``` -You can see available options [here](https://github.com/Automattic/juice/tree/v3.0.1#options) +You can see available options [here](https://github.com/Automattic/juice/tree/v4.0.2#options) ## Contributing diff --git a/package.json b/package.json index 6ae8ba9..8c0f652 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "grunt-inline-css", "description": "Takes an html file with css link and turns inline. Great for emails.", - "version": "1.0.0", + "version": "1.0.1", "homepage": "https://github.com/jgallen23/grunt-inline-css", "author": { "name": "Greg Allen" @@ -45,6 +45,6 @@ "gruntplugin" ], "dependencies": { - "juice": "~3.0.1" + "juice": "~4.0.2" } } diff --git a/tasks/inline_css.js b/tasks/inline_css.js index 451c82b..1a081f4 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 css link and turns inline. Great for emails.', function() { // Merge task-specific and/or target-specific options with these defaults. var options = this.options(); + var codeBlocks = this.data.codeBlocks; var done = this.async(); var index = 0; var count = this.files.length; + juice.codeBlocks = Object.assign({}, juice.codeBlocks, codeBlocks); + var increaseCount = function () { index++; if (index === count) {