Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't write blank lines in pure control structures' lines #277

Closed
delucas opened this issue Feb 25, 2014 · 1 comment
Closed

Don't write blank lines in pure control structures' lines #277

delucas opened this issue Feb 25, 2014 · 1 comment

Comments

@delucas
Copy link

delucas commented Feb 25, 2014

There are cases when you need to iterate over a collection, or put some kind of condition and don't want to get the \n character at the end of each control line.

Example:

{{#if something}}\n
  Some text\n
{{/if}}\n

Output

\n
  Some text\n
\n

In handlebars.js, it gets fixed with {{~#if something}}. See issue #336 in handlebars.js for further info. It seems to be resolved in a newer version of handlebars.js (1.10).

@jknack jknack added this to the 1.3.1 milestone Mar 17, 2014
@jknack
Copy link
Owner

jknack commented Apr 24, 2014

I wrote two examples of how to deal with this: https://gist.github.com/jknack/11237680

One example use prettyPrint=true(MustacheSpec) and the other use ``~`. I think you put the tildes in the wrong place.

@jknack jknack added the wontfix label Apr 28, 2014
@jknack jknack closed this as completed Apr 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants