-
Notifications
You must be signed in to change notification settings - Fork 714
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
{strip} doesn't remove white-spaces after comments {* *} #447
Comments
jeez all know this. Is this is problem to you :) |
This happens because smarty recognizes a newline directly following a comment as part of the comment and removes it. This is expected, since Smarty 2 would also do this. E.g.:
Is rendered as:
This, however causes the newline before the 4 spaces after the comment in de example above to have disappeared from the text content section. We can't take out any spaces at the beginning of a text content section, since that would remove inline spaces following a tag, e.g.:
would run together as
instead of the expected:
Maybe we can merge consecutive text content sections before compiling them? |
I understand this is an implementation detail. In any case, this issue prevents me from commenting some parts of the templates. It is inconvenient. |
Could you test the branch in the linked Pull Request that I submitted yesterday? that should fix it.
|
Thank you @wisskid ! If I find any issue or edge case, I'll let you know. It's been a while since I've posted this issue, thus I don't remember all the details. This PR would definitely change the way we comment in smarty templates :) |
ping @peon501 |
It looks great so far! |
Thats good to hear. We noticed there are still issues with constructs such as;
```
{strip}
{if $test} {* comment *}
{$a = 3}
{/if}
{/strip}
```
|
@duzun ty for ping I will check it later :) |
Here is an example:
->
And there are some other edge cases around comments.
The text was updated successfully, but these errors were encountered: