From 65a8135c3166427a15f845d7fa158aabbb0ebdd2 Mon Sep 17 00:00:00 2001 From: Maciej Lach Date: Fri, 7 Apr 2017 19:01:37 +0200 Subject: [PATCH 1/2] Upgrade juice to 4.0.2 --- README.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ad63930..d1333df 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,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..2a3a1e9 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,6 @@ "gruntplugin" ], "dependencies": { - "juice": "~3.0.1" + "juice": "~4.0.2" } } From ca74ea24b344ec4ed21846aeba05cd280c3df898 Mon Sep 17 00:00:00 2001 From: Maciej Lach Date: Fri, 7 Apr 2017 19:03:34 +0200 Subject: [PATCH 2/2] Enable configuration of juice.codeBlocks --- README.md | 2 ++ package.json | 2 +- tasks/inline_css.js | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d1333df..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: { diff --git a/package.json b/package.json index 2a3a1e9..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" 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) {