Skip to content
This repository has been archived by the owner on Nov 27, 2017. It is now read-only.

Allow to configure juice.codeBlocks to support general exclusion of fenced code, like EJS, HBS, etc. #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -45,6 +45,6 @@
"gruntplugin"
],
"dependencies": {
"juice": "~3.0.1"
"juice": "~4.0.2"
}
}
3 changes: 3 additions & 0 deletions tasks/inline_css.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down