assemble/assemble — pull request #143 by Arkkimaagi (2013-05-04 09:17:21+00:00)
Title: Added an option to remove extra whitespace around hbs tags

It annoys me and apparently many others that handlebars does not strip extra whitespace around its elements when compiling.

wycats/handlebars.js#336

This is a quick hack to make it strip that extra whitespace as if the rows with only a single hbs tag were not separate rows. This pull possibly has some bugs in its regexp, but it's a start.

I thought that maybe this should be toggleable by the user, so only by adding an option: removeHbsWhitespace:true to grunt config of assemble will enable this feature. (without it, no ill effects should happen)

With removeHbsWhitespace enabled code like this:
```
{{#each collection}}

{{this}}

{{/each}}
```
normally resulting this:
```

ele1

ele2

ele3

```

would be preprocessed to be like this:
```
{{#each collection}}

{{this}}

{{/each}}
```
resulting this:
```

ele1

ele2

ele3

```

This feels more natural and helps creating cleaner and more readable layouts, partials and page code.