我正在用 jinja2 在 Flask 中尝试一个简单continue
的内部for-loop
{% for num in range(0,10) %}
{% if num%2 == 0 %}
{% print num %}
{% else %}
{% continue %}
{% endif %}
我得到这个错误
TemplateSyntaxError: Encountered unknown tag 'continue'. Jinja was looking for the following tags: 'endif'. The innermost block that needs to be closed is 'if'.
这是我遵循的 jinja2 文档... http://jinja.pocoo.org/docs/templates/#loop-controls