From 2c3681c3b2c485e4db3c586d990308a24a5e8ca5 Mon Sep 17 00:00:00 2001 From: Sindre Wimberger Date: Wed, 29 Jan 2014 22:13:05 +0100 Subject: [PATCH 1/2] update inlineCSS to work with options parameter/ template evaluation --- tasks/grunt-htmlrefs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/grunt-htmlrefs.js b/tasks/grunt-htmlrefs.js index ef5a457..bf45a15 100644 --- a/tasks/grunt-htmlrefs.js +++ b/tasks/grunt-htmlrefs.js @@ -71,8 +71,10 @@ module.exports = function (grunt) { }, inlinecss : function (block) { var indent = (block.raw[0].match(/^\s*/) || [])[0]; + block.dest = grunt.template.process(block.dest, {data: block}); var lines = grunt.file.read(block.dest).replace(/\r\n/g, '\n').split(/\n/).map(function(l) {return indent + l}); - return indent + grunt.template.process(inlineCSSTemplate, {data: {dest:lines}}); + var options = _.extend(block, {dest:lines}); + return indent + grunt.template.process(inlineCSSTemplate, {data: options}); }, include : function (block, lf, includes) { // let's see if we have that include listed From 01233d0682fc045f9e3f146bb92aae68a64b55fb Mon Sep 17 00:00:00 2001 From: Sindre Wimberger Date: Fri, 13 Jun 2014 18:45:42 +0200 Subject: [PATCH 2/2] fix with worng var declaration --- tasks/grunt-htmlrefs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/grunt-htmlrefs.js b/tasks/grunt-htmlrefs.js index 5de775c..bc432f4 100644 --- a/tasks/grunt-htmlrefs.js +++ b/tasks/grunt-htmlrefs.js @@ -87,7 +87,7 @@ module.exports = function(grunt) { }, inlinecss: function(block) { var indent = (block.raw[0].match(/^\s*/) || [])[0]; - var block.dest = grunt.template.process(block.dest, {data: block}); + block.dest = grunt.template.process(block.dest, {data: block}); var lines = grunt.file.read(block.dest).replace(/\r\n/g, '\n').split(/\n/).map(function(l) { return indent + l; });