Skip to content

Commit

Permalink
fixed a bug with filtered loops
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
mitsuhiko committed May 4, 2008
1 parent 6b44952 commit c072564
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/_templates/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h1 id="index">Index</h1>
{% for key, entries in genindexentries %}
<h2 id="{{ key }}">{{ key }}</h2>
<table class="indextable"><tr>
{%- for column in entries|slice(2) %}{% if column %}
{%- for column in entries|slice(2) if column %}
<td><dl>
{%- for entryname, (links, subitems) in column %}
<dt>{% if links %}<a href="{{ links[0] }}">{{ entryname|e }}</a>
Expand All @@ -29,7 +29,7 @@ <h2 id="{{ key }}">{{ key }}</h2>
{%- endif -%}
{%- endfor %}
</dl></td>
{%- endif %}{% endfor %}
{%- endfor %}
</tr></table>
{% endfor %}

Expand Down
2 changes: 1 addition & 1 deletion jinja2/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def parse_for(self):
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'))
Expand Down

0 comments on commit c072564

Please sign in to comment.