Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

else tag expressions #150

Closed
jg-rp opened this issue Feb 7, 2024 · 0 comments · Fixed by #152
Closed

else tag expressions #150

jg-rp opened this issue Feb 7, 2024 · 0 comments · Fixed by #152
Labels
bug Something isn't working

Comments

@jg-rp
Copy link
Owner

jg-rp commented Feb 7, 2024

Unlike {% if <expression> %} and {% elsif <expression> %}, {% else %} does not expect an expression (obviously). With Shopify/Liquid, anything between else and the closing tag delimiter (%}) is silently ignored, even in strict mode.

{% if false %}1{% else nonsense %}2{% endif %}

Expected output

2

With the same template, Python Liquid will output nonsense2, treating nonsense as part of the else block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant