{{#br [number of breaks]}}
// content
{{/br}}
Handlebars.registerHelper('br', function(n, options) {
options = options || {};
var ele = '';
var count = n - 1;
for (var i = 0; i <= count; i++) {
ele += '<br>';
}
var res = options.fn(this).replace(/[\r?\n?]+/g, ele);
return new Handlebars.SafeString(res);
});
Results in
Or a single newline
{{#br 1}}
content
here
{{/br}}
Results in
content<br>
here