bkiers / Liqp

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

!= working as == #286

Closed aakash10897 closed 11 months ago

aakash10897 commented 11 months 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 11 months ago

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

msangel commented 11 months ago

done in master, (now need to prepare release)