Я пытаюсь обновить jinja2.8 до 2.10, и у меня возникла проблема.В 2.8 мой код вроде:
Case:
{% filter indent(2) %}
{% include "work.tpl" without context %}
{% endfilter %}
End
work.tpl вот так:
Row 1
Row 2
Итак, результат был:
Case:
Row 1
Row 2
End
Но когда я обновился до2.10, мой результат:
Case:
Row 1
Row2
End
Как я могу сделать, как jinja2.8 в 2.10.Пожалуйста, помогите мне!
Мой файл здесь: main.py
from jinja2 import Template, Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('.'))
template = env.get_template('template.tpl')
rendered = template.render()
print(str(rendered))
template.tpl здесь:
Test
{% filter indent(4, first=True) -%}
{% include 'template2.tpl' without context %}
{%- endfilter %}
Test
И template2.tpl здесь:
Row 1
Row 2
Row 3
И результат
Test
Row 1
Row 2
Row 3
Test