See the Whitespace Control section in the [http://handlebarsjs.com/expressions.html](handlebarsjs documentation):
Template whitespace may be omitted from either side of any mustache statement by adding a ~ character by the braces. When applied all whitespace on that side will be removed up to the first handlebars expression or non-whitespace character on that side.
{{#each nav ~}}
<a href="{{url}}">
{{~#if test}}
{{~title}}
{{~^~}}
Empty
{{~/if~}}
</a>
{{~/each}}
See the Whitespace Control section in the [http://handlebarsjs.com/expressions.html](handlebarsjs documentation):