summaryrefslogtreecommitdiff
path: root/jinja2/nodes.py
diff options
context:
space:
mode:
authorAdrian Moennich <adrian@planetcoding.net>2017-08-22 22:59:57 +0200
committerAdrian Moennich <adrian@planetcoding.net>2017-08-22 23:12:09 +0200
commitcde2a54b87876bd02b283db2f52aca3d9272a92c (patch)
tree2cce6a0e6958fdb7d6c34cb9012f5216c2ab7d21 /jinja2/nodes.py
parentd117425f5ed3f542100f20d3bf700ae7bc54039f (diff)
downloadjinja2-2.9-maintenance.tar.gz
Compile `elif` tag to `elif` instead of `else: if`2.9-maintenance
This avoids deep nesting in case of many `{% elif .. %}` blocks (which would fail during execution) and also deep recursion (which may fail during compilation) fixes #759
Diffstat (limited to 'jinja2/nodes.py')
-rw-r--r--jinja2/nodes.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/jinja2/nodes.py b/jinja2/nodes.py
index aa4df72..59e0765 100644
--- a/jinja2/nodes.py
+++ b/jinja2/nodes.py
@@ -314,7 +314,7 @@ class For(Stmt):
class If(Stmt):
"""If `test` is true, `body` is rendered, else `else_`."""
- fields = ('test', 'body', 'else_')
+ fields = ('test', 'body', 'elif_', 'else_')
class Macro(Stmt):