email-templates
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -17,2 +17,5 @@ [antoinepairet]: https://github.com/antoinepairet | ||
## 1.3.0 (2015-05-22) | ||
* development: [@andybrown](https://github.com/astephenb) Supports node-sass 3.0 | ||
## 1.2.1 (2015-03-18) | ||
@@ -19,0 +22,0 @@ * enhancement: [@kingcody][kingcody] Supports less 2.0 |
@@ -14,3 +14,3 @@ /** | ||
'.jade' : cons.jade.render, | ||
'.ejs' : renderEjs, | ||
'.ejs' : cons.ejs.render, | ||
'.swig' : cons.swig.render, | ||
@@ -52,13 +52,2 @@ '.hbs' : cons.handlebars.render, | ||
function renderEjs(source, options, cb) { | ||
var ejs = require('ejs') | ||
try { | ||
var tmpl = ejs.compile(source, options) | ||
cb(null, tmpl(options)) | ||
} catch (err) { | ||
console.error(err.stack) | ||
cb(err) | ||
} | ||
} | ||
// CSS pre-processors | ||
@@ -94,11 +83,16 @@ function renderLess(source, locals, cb) { | ||
// Result handlers required by sass. | ||
// Result handlers required by node-sass < 3.0.0. | ||
function errorHandler(err) { cb(err) } | ||
function successHandler(data) { cb(null, data.css)} | ||
locals.success = successHandler | ||
locals.error = errorHandler | ||
locals.data = source | ||
locals.includePaths = [locals.templatePath]; | ||
locals.success = successHandler | ||
locals.error = errorHandler | ||
sass.render(locals) | ||
sass.render(locals, function(err, result) { | ||
if (err) { return cb(err); } | ||
cb(null, result.css.toString()); | ||
}); | ||
} | ||
@@ -105,0 +99,0 @@ |
{ | ||
"name": "email-templates", | ||
"description": "Node.js module for rendering beautiful emails with ejs, jade, swig, hbs, or handlebars templates and email-friendly inline CSS using juice.", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"author": "Nick Baugh <niftylettuce@gmail.com>", | ||
@@ -81,3 +81,3 @@ "contributors": [ | ||
"styl": "^0.2.7", | ||
"node-sass": "^2.0.1", | ||
"node-sass": "^3.1.1", | ||
"sinon": "^1.10.2", | ||
@@ -84,0 +84,0 @@ "sinon-chai": "^2.7.0", |
@@ -100,3 +100,3 @@ | ||
- `styl@^0.2.7` | ||
- `node-sass@^0.9.3` | ||
- `node-sass@^3.1.1` | ||
@@ -103,0 +103,0 @@ ```bash |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63268
1039