Skip to content

Macro recursion broken in versions 2.1.8 and later #91

@derkork

Description

@derkork

Consider the following code:

{% macro example(prefix, items) %}
{{ prefix }} {{ items | first }}
{% if (items | count > 1) %}{{ example( prefix ~'-', items[1:items|count]) }}{% endif %}
{% endmacro %}

{{  example('-',['lorem', 'ipsum', 'dolor']) }}

With jinjava 2.1.7 or earlier this correctly outputs:

- lorem

-- ipsum

--- dolor

Starting with version 2.1.8 this no longer works and instead just outputs:

- lorem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions