-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Comparisons within assign
#1102
Comments
assign
assign
Hey, @andymikulski I agree this is would be a cool addition to Liquid. There are a lot of things we are currently working on but would love to think this will make it in one day. If someone is willing to take a crack at a pull request in the meantime I'm happy to review it. For a bit of direction |
one wonders a bit what went wrong that this isn't standard... security is the issue I assume? |
@shopmike wrote:
The same should be applied to printing out variables: |
It appears that the
assign
operator doesn't like comparisons (i.e.[thing] contains [other thing]
). For instance, I would expect this to work:But produces the error:
Expected end_of_string but found comparison in [...]
I've used the following as a workaround:
While the latter works, the former is much more concise and is what I would expect to work. Note that I found this while trying to use the
or
operator as well, but seeing as comparisons themselves aren't accepted, I don't think the parser even got that far.edit 10/30/2020: The following snippet also works and is a bit more compact:
The text was updated successfully, but these errors were encountered: