Commit 14b3e308 authored by wu-lee's avatar wu-lee

lib/helpers.js - add a parags helper, for use in email templates.

parent a16f1e60
......@@ -34,6 +34,14 @@ module.exports = {
return new Handlebars.SafeString(link);
},
/** Html escapes text, but converts adjacent newlines into paragraph tags */
parags: function() {
const [opts, text] = getopts(arguments);
text = Handlebars.Utils.escapeExpression(text);
text = text.replace(/\n\s*\n/mg, '<p>');
return new Handlebars.SafeString(text);
},
// Ghost emulations
asset: function(path) {
return '/'+path;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment