aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2008-04-13 16:31:08 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2008-04-13 16:31:08 +0200
commit625215e9153d2f2a0a40d3b2182f0c5d216502b9 (patch)
tree67e12ced9c96fae234acd1e61968440645d46ea7 /examples
parent2e7b54f7d89d5d3436ce573d1ade8cca26b9f162 (diff)
downloadjinja-625215e9153d2f2a0a40d3b2182f0c5d216502b9.tar.gz
optimizer can optimize filtered for loops now
--HG-- branch : trunk
Diffstat (limited to 'examples')
-rw-r--r--examples/test_loop_filter.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/test_loop_filter.py b/examples/test_loop_filter.py
index 64f32d35..49c2efcf 100644
--- a/examples/test_loop_filter.py
+++ b/examples/test_loop_filter.py
@@ -2,11 +2,11 @@ from jinja2 import Environment
tmpl = Environment().from_string("""\
<ul>
-{% for item in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] if item % 2 == 0 %}
+{%- for item in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] if item % 2 == 0 %}
<li>{{ loop.index }} / {{ loop.length }}: {{ item }}</li>
-{% endfor %}
+{%- endfor %}
</ul>
-{{ 1 if foo else 0 }}
+if condition: {{ 1 if foo else 0 }}
""")
print tmpl.render(foo=True)