-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Colon silently made mandatory in 9.10.0 #208
Comments
Thank you for the work to find it out. This case is not covered before and I'm surprised to know it worked once upon a time.
You're right, it should be regarded invalid for |
## [9.11.5](v9.11.4...v9.11.5) (2020-03-24) ### Bug Fixes * throws on invalid arguments for prepend/append, fixes [#208](#208) ([479c633](479c633))
🎉 This issue has been resolved in version 9.11.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I was actually expecting the compiler to throw a syntax error because of the extra tokens rather than just discard the tokens and call the function with no arguments. I picked prepend arbitrarily, but this approach would not help for e.g. round, which has an optional first argument:
I would be worried that anyone who has missed the colon might not notice that the argument has not been passed to round at all. |
It's intentional in Liquid to be safe and customer facing. I tried the Ruby version both the following renders to '{{ 3.456 | round }}'
'{{ 3.456 | round 2 }}'
'{{ 3.456 | round 2 a b c ? }}' But for |
I see! I guess it makes sense to be consistent. Thank you for confirming, and so quickly, too. |
It looks like the behaviour of filters has changed where there is no colon between a filter and its arguments between 9.9.0 and 9.10.0. I haven't spotted anything in the changes to indicate this was intentional. Where there is no colon after the filter name, arguments are ignored. If the original behaviour is now unsupported, I would have expected to see an error thrown.
The text was updated successfully, but these errors were encountered: