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

Multiple else blocks #151

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

Multiple else blocks #151

jg-rp opened this issue Feb 7, 2024 · 1 comment · Fixed by #152
Labels
future Fixes to be included in the 'future' environment incompatibility Behavioural differences between Python and Ruby Liquid

Comments

@jg-rp
Copy link
Owner

jg-rp commented Feb 7, 2024

In strict mode, Python Liquid raises a LiquidSyntaxError if an {% if %} block contains multiple else tags. Shopify/Liquid silently ignores all but the first else tag and its block.

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

Expected output

2
@jg-rp jg-rp added incompatibility Behavioural differences between Python and Ruby Liquid future Fixes to be included in the 'future' environment labels Feb 7, 2024
@jg-rp
Copy link
Owner Author

jg-rp commented Feb 7, 2024

Extraneous elsif blocks are silently ignored by Shopify/Liquid too, even in strict mode.

{% if false %}1{% else %}2{% else %}3{% elsif true %}4{% endif %}

Expected output

2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future Fixes to be included in the 'future' environment incompatibility Behavioural differences between Python and Ruby Liquid
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant