Checklist
Expected Behavior
The following Liquid template:
{% case 1 %}{% when 1 or 2 %}{% endcase %}
Throws an error:
Liquid error: syntax error in "{%when 1 or 2" in {% case 1 %}
Actual Behavior
There should not be an error and the result should be the same as parsing the following template:
{% case 1 %}{% when 1, 2 %}{% endcase %}
Detailed Description
According to the Liquid documentation, there are two ways to separate multiple values with the same expression in a case tag:
Provide the values as a comma-separated list, or separate them using an or operator.
This package already supports the former, but the latter throws an error (see above or Go Playground example).
Possible Solution
The when tag parser would have to treat or in the same way as , .
Checklist
IsTemplateErrorreturns false.)Expected Behavior
The following Liquid template:
{% case 1 %}{% when 1 or 2 %}{% endcase %}Throws an error:
Actual Behavior
There should not be an error and the result should be the same as parsing the following template:
{% case 1 %}{% when 1, 2 %}{% endcase %}Detailed Description
According to the Liquid documentation, there are two ways to separate multiple values with the same expression in a
casetag:This package already supports the former, but the latter throws an error (see above or Go Playground example).
Possible Solution
The
whentag parser would have to treatorin the same way as,.