-
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 inserts space after comments. #943
Comments
Seems related to #447 |
Mmm I see. Well, I used Smarty 3.1 up to now (long term app, now upgraded to PHP 8.3), and that didn't have this issue (as in, strip did indeed strip all whitespace). So it must have been introduced some time after - and yea, that definitely was an unwanted change at least for me (and the other guy in #447). It's your call what you do, but since Smarty didn't have this issue before, it seems like a regression introduced somewhere, and anyone who has an issue with a fix has essentially become reliant on a bug ;P It also seems to make little sense to keep this behavior, because {strip} specifically states that it removes all whitespace - and well, no, it doesn't. It keeps one in there after a comment (which shouldn't have any effect on the output to start with). Which makes the documentation wrong ;) My workaround is to compile the smarty templates myself before passing them to smarty, removing all the comments, so I still have them in the original files, and smarty doesn't see them anymore - but you know, that's hacky as all hell ;) |
It was meant as a note to myself, no worries. Can you figure out what change/version introduced it? |
results in
with a space after Test.
Removing the comment results in the removal of the space.
Happenes in the newest smarty-version, didn't test the others.
The text was updated successfully, but these errors were encountered: