From c0725640ebee04fdd7061aad54f73613500714ee Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 4 May 2008 22:43:19 +0200 Subject: [PATCH] fixed a bug with filtered loops --HG-- branch : trunk --- docs/_templates/genindex.html | 4 ++-- jinja2/parser.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_templates/genindex.html b/docs/_templates/genindex.html index 9c09d0f..e31a578 100644 --- a/docs/_templates/genindex.html +++ b/docs/_templates/genindex.html @@ -12,7 +12,7 @@ {% for key, entries in genindexentries %}

{{ key }}

- {%- for column in entries|slice(2) %}{% if column %} + {%- for column in entries|slice(2) if column %} - {%- endif %}{% endfor %} + {%- endfor %}
{%- for entryname, (links, subitems) in column %}
{% if links %}{{ entryname|e }} @@ -29,7 +29,7 @@ {%- endif -%} {%- endfor %}
{% endfor %} diff --git a/jinja2/parser.py b/jinja2/parser.py index 05d2e32..5298061 100644 --- a/jinja2/parser.py +++ b/jinja2/parser.py @@ -109,7 +109,7 @@ class Parser(object): self.stream.expect('name:in') iter = self.parse_tuple(no_condexpr=True) test = None - if self.stream.current.type is 'name:if': + if self.stream.current.test('name:if'): self.stream.next() test = self.parse_expression() body = self.parse_statements(('name:endfor', 'name:else')) -- 2.26.2