-
Notifications
You must be signed in to change notification settings - Fork 132
Redundant newlines #154
Comments
There is a special syntax Look at tests for details. |
This don't remove newlines, If I have first template I don't have any newlines and spaces between items in |
Also if I use
I don't get newline at the begining but I also don't get spaces before
|
Please, provide a test case containing:
In this case we could talk about your use case in more details. Be aware: nobody (except you) has neither |
I have code like this:
the result is:
extra newline at the beginning, expected result:
no extra newline at the beginning it don't happen if I use bar helper as block ( |
Same heppen if you use this template:
|
Instead of {{bar "baz"}}
{{#each foo}}
{{this}}
{{/each}} try to use {{bar "baz"}}
{{~#each foo}}
{{this}}
{{/each}} (notice the tilde position) |
yes it works, thanks. but maybe this can be changed in the library to not introduce new line if empty non block helper is used, same as block helper. |
You're welcome. You see, Handlebars.php tries to work in the same way as Handlebars.js. As I know, JS implementation introduces new line for empty non block helpers. So PHP implementation should follow this behavior. There is little we can do here. |
I have another problem with custom helpers I have template like this:
and I end up with this result:
and if I add
adding ~ to beginning of |
I have newline issue, I have header helpers that create http headers.
If I have template like this:
I have redundant newline at the beginning and when I'm using this one:
I have newline at the begining of each iteration (in fact I have two newlines, one expected).
The text was updated successfully, but these errors were encountered: