-
Notifications
You must be signed in to change notification settings - Fork 96
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
Integer and Float Comparisons After Using Times Filter #267
Comments
Hello! tech details: problem was in this part of code:
in a case when variables are string (and in this case they are since variable evaluation perform to string) |
Another interesting question is about compatibility of this samples with original liquid. /usr/lib/ruby/gems/3.1.0/gems/liquid-5.4.0/lib/liquid/parser.rb:18:in `consume': Liquid syntax error: Expected end_of_string but found comparison in "{{ '98' > comparingValue }}" (Liquid::SyntaxError) So in solving this issue the preference for ruby's implementation will be given. |
@msangel Shouldn't we follow Jekyll's implementation here? We might control this using Flavor. |
Yep, we should. |
Will debug Jekyll ones later.... |
In the end they are the same, Jekyll uses |
Jekyll default configuration is Traces are: |
Currently, this library has only |
So we have two options:
What would you pick? |
During my active development, I've always thrived for compatibility with Ruby's Liquid library. But given this is rather odd, I'd go for the predictable route. But given I am not actively working on this, if you'd rather be compatible with Ruby, I'd support that too @msangel. |
Ok. My decision is: by default this will behave as expected(as of now). BUT there will be a flag that will turn on either the first token either error on something more than one token. If someone will need full compatibility, the one will get it. output
: outStart expr filter* OutEnd
; |
Closed fully in af65618 accoarding to exact ruby behavior |
I'm observing some odd behavior when using the times filter with a float value. In both of the cases below, the
comparingValue
variable should be98.0
. In both tests I check if99
isgreater than
that value. For some reason, the case with thetimes
filter fails withfalse
and the case with thedivide_by
filter passes withtrue
.I believe this is a bug and that both cases should pass with
true
.The text was updated successfully, but these errors were encountered: