fabpot/Twig — Issue #562: Loop variable sometimes not included
Author: timewasted
Created: 2011-12-21 04:51:30+00:00
State: open

When writing the following, the loop variable is not included:

{% for i in 1..5 %}
{% if loop.first %}
First
{% else %}
Not first
{% endif %}

However, if I add any white space (or any other content) between {% for i in 1..5 %} and {% if loop.first %}, the loop variable gets included:

{% for i in 1..5 %}

{% if loop.first %}
First
{% else %}
Not first
{% endif %}