Closed MarcDiethelm closed 10 years ago
@MarcDiethelm This isn't something that I am interested in adding. In one of the recent versions of Handlebars, whitespace control was added, so my suggestion would be to use that feature to handle things like this; and it will work transparently with this package.
I was afraid you were going to say this. Unfortunately that's not what Handlebars' whitespace control does. It can only eliminate whitespace (introduced around the control structures). As it stands we have no way of indenting views. To me it's as frustrating as Handlebars synchronous nature.
Since Handlebars doesn't offer this functionality it would be truly awesome if you could add the functionality to exp3hbs. A function implementing this could be as simple as:
res.render('foo', {indent: 2})
for example would render thefoo
view with two levels of indentation. Indentation would be completely optional of course, as a performance hit must be expected obviously.Let me know if you're interested in a pull request. :)
There was a pull requet at Handlebars for this: https://github.com/wycats/handlebars.js/pull/237