bkiers / Liqp

An ANTLR based 'Liquid Template' parser and rendering engine.
MIT License
165 stars 94 forks source link

!= working as == #286

Closed aakash10897 closed 1 year ago

aakash10897 commented 1 year ago

[{%-](<img width="1046" alt="Screenshot 2023-10-06 at 7 43 54 PM" src="https://github.com/bkiers/Liqp/assets/25743992/84c60a19-0d0d-444b-9270-634161fc6dab">) assign value = 5.0 | round: 1 -%} {%- if value >= 4.0 and value <= 4.2 -%} Très bien {%- elsif value >= 4.3 and value <= 4.7 -%} Superbe {%- elsif value >= 4.8 and value <= 4.9 -%} Fabuleux {%- elsif value != 5.0 -%} Exceptionnel {% endif %}

the above template is rendering to "Exceptionnel" where as it should return empty.

{%- assign value = 5.0 | round: 1 -%} {%- if value >= 4.0 and value <= 4.2 -%} Très bien {%- elsif value >= 4.3 and value <= 4.7 -%} Superbe {%- elsif value >= 4.8 and value <= 4.9 -%} Fabuleux {%- elsif value == 5.0 -%} Exceptionnel {% endif %}

This one is rendering to "" whereas it should render to "Exceptionnel"

Correct rendering from shopify.dev

Screenshot 2023-10-06 at 7 44 02 PM Screenshot 2023-10-06 at 7 43 54 PM
msangel commented 1 year ago

Hello! I am working on related bug right now. Will add this test case for checking too.

msangel commented 1 year ago

done in master, (now need to prepare release)