-
Notifications
You must be signed in to change notification settings - Fork 715
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
outputfilter.trimwhitespace.php strips KnockoutJS comments #82
Comments
outputfilter.trimwhitespace.php is not loaded by default, you must explicitly load it. Just don't load the filter if you don't want it applied? |
You are correct, but then it's still an all-or-nothing deal. It would be nice if they were either separated (which I guess would be a performance drain) or configurable. |
You can make them separate yourself with custom output filters. Copy the filter and make your own rules. Another approach, make a prefilter to replace the comment tags you want to keep with a placeholder, then swap them back with an output filter after the trimming is complete (load your filter after the trimwhitespace filter.) |
The change is committed now |
Merge release-2.0.8 into master branch
KnockoutJS has a syntax for MVVM that uses HTML comments in the form of
<!-- ko ... -->...</!-- /ko -->
.The
outputfilter.trimwhitespace.php
output filter strips out all comments (except the MSIE-specific ones). As far as I know, there is no workaround or fix except stripping out the line that removes the comments from the Smarty code; obviously not a good solution.Is it possible to add a way to keep these (or other framework's) comments?
See this old stackoverflow for more details: http://stackoverflow.com/questions/15009881/smarty-comment-stripping-and-knockoutjs
The text was updated successfully, but these errors were encountered: