Open st19311 opened 5 months ago
Seems related to https://github.com/smarty-php/smarty/issues/447 May be tricky to 'fix' as this might mean unwanted changes for others.
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?
The problem seems to be identical as/related to #827 and #555, both caused by a fix in 2017/2018.
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.