Git Product home page Git Product logo

Comments (4)

wisskid avatar wisskid commented on August 27, 2024

Seems related to #447
May be tricky to 'fix' as this might mean unwanted changes for others.

from smarty.

st19311 avatar st19311 commented on August 27, 2024

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 ;)

from smarty.

wisskid avatar wisskid commented on August 27, 2024

It was meant as a note to myself, no worries. Can you figure out what change/version introduced it?

from smarty.

wisskid avatar wisskid commented on August 27, 2024

The problem seems to be identical as/related to #827 and #555, both caused by a fix in 2017/2018.

from smarty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.