harttle / liquidjs

A simple, expressive, safe and Shopify compatible template engine in pure JavaScript.
https://liquidjs.com
MIT License
1.52k stars 238 forks source link

Case/When should evaluate multiple When statements #559

Closed sebastienros closed 1 year ago

sebastienros commented 1 year ago
{% assign tag = 'Love' %}

{% case tag %}
  {% when 'Love' or 'Luck' %}
    This is a love or luck potion.
  {% when 'Strength','Health', 'Love' %}
    This is a strength or health or love potion.
  {% else %}
    This is a potion.
{% endcase %}

Should display both statements. https://shopify.dev/api/liquid/tags/case https://github.com/Shopify/liquid/blob/master/lib/liquid/tags/case.rb#L73-L87

harttle commented 1 year ago

Fixed in version 10.2, see https://github.com/harttle/liquidjs/commit/d17813ef5217264bd08f741b0e1f713bedf2d464