harttle / liquidjs

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

parsing should fail if {% else foo = 'blah' %} #713

Closed amit777 closed 1 month ago

amit777 commented 2 months ago

I don't believe this should be valid syntax:

{% if foo %} foo
{% else foo = 'blah' %}
{% endif %}

If there is stuff after the {% else ... %} I believe there should be a parse error?

amit777 commented 1 month ago

thanks for the quick patch on this! And nice catches on potential ordering issues with elsif and else. I didn't think of that but it's definitely possible to happen.