-
Notifications
You must be signed in to change notification settings - Fork 275
Closed
Description
The following code triggers a parse error in twig.js (this compiles successfully in its PHP counterpart). Note I've only tested this for the elseif tag. It could affect other tags as well. Removing the extra space after elseif fixes the parse error.
Hi there
{% if true %}
Yup
{% else %}
{% if 1 > 2 %}
This should not print
{% elseif 5 > 2 %}
This should print
{% endif %}
{% endif %}
Expected behavior: code compiles successfully despite the extra space after elseif
Actual behavior: code returns the following error:
TwigException: Unable to parse 'elseif 5 > 2'
Node version 12.13.1
Twig version 1.14.0