BUG: forloop.index disrupted by nested forloop

If there is a forloop nested within another forloop, the use of {{forloop.index}} is blocked anywhere preceding the nested forloop.

eg; In BC the following code and output seems correct:

{% for i in (1..4) %}
    *{{forloop.index}}*<br>
    {% for x in (1..2) %}
        ^{{forloop.index}}^<br>
    {% endfor %}
    #{{forloop.index}}#<br>
{% endfor %}

OUTPUT:

*1*
^1^
^2^
#1#
*2*
^1^
^2^
#2#
*3*
^1^
^2^
#3#
*4*
^1^
^2^
#4#

But, in Treepl the same liquid forloop renders as:

*1*
^1^
^2^
##
**
^1^
^2^
##
**
^1^
^2^
##
**
^1^
^2^
##

After the nested forloop executes, the top level indexes are no longer rendered.

Hi @Adam.Wilson - Sorry for the late reply, I have not had access to the Treepl site since the SSO update, so haven’t had a chance to add this to the public backlog before now :slight_smile:

Added here: https://treepl.co/public-backlog-state/request/bug-forloop-index-disrupted-by-nested-forloop