Intentional indentation and newlines

This commit is contained in:
Tim Schaub
2015-11-14 12:20:50 -07:00
parent 58d22350d8
commit 74f2b4cb74
2 changed files with 22 additions and 17 deletions

View File

@@ -233,6 +233,16 @@ function main(callback) {
helpers: {
md: function(str) {
return new handlebars.SafeString(marked(str));
},
indent: function(text, options) {
if (!text) {
return text;
}
var count = options.hash.spaces || 2;
var spaces = new Array(count + 1).join(' ');
return text.split('\n').map(function(line) {
return line ? spaces + line : '';
}).join('\n');
}
}
}))