liquid icon indicating copy to clipboard operation
liquid copied to clipboard

Case statement evaluation renders multiple when conditions if a value is repeated

Open cibingeorge opened this issue 1 year ago • 0 comments

If i render

{% assign var = "B" %}
{% case var %} 
{% when "A" or "B" %}
A or B
{% when "B" or "C" %}
B or C
{% when "C" or "D" or "E" %} 
C or D or E
{% when "D" or "E" or "F" %}  
D or E or F
{% else %} 
no match
{% endcase %}

I will get

A or B

B or C

Is this the intended behavior of case when? or a bug due to a missing break in lib/liquid/tags/case.rb#L85

cibingeorge avatar Jun 06 '24 02:06 cibingeorge