wycats/handlebars.js — pull request #336 by kpdecker (2013-10-15 02:41:52+00:00)
Title: Unecessary Whitespace

I have come across an issue with the each block helper. It appears that it is creating unecessary whitespace. I copied the each block helper example (http://handlebarsjs.com/#iteration) exactly and my results were not the same. My results ended up like the following:

```

ele1

ele2

ele3

```
instead of the expected:

```

ele1

ele2

ele3

```

This might seem like a non issue but say we have a template like the following:

```

```

My expected output would be:

```

ele1

ele2

ele

```

but I instead get:

```

ele1

ele2

ele3

```

In an AJAX application where regular polling for data and rendering that data with a template like the previous can result in a large amount of unecessary dom growth. We actually encountered such an issue. All of the extra whitespace elements would spike the CPU usage under FF15 100% after 12 hours.
Here is a link to a set of tests I wrote to demonstrate the issue https://github.com/jayfunk/Handlebars-Whitespace-Test