Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow more than two consecutive curlies to appear in templates (and use

the innermost).  This was previously a syntax error in the generated python.
  • Loading branch information...
commit fca7c831341b864916c6c97bdbdb2f95d95b2c12 1 parent 8c096b2
Ben Darnell authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 tornado/template.py
View
7 tornado/template.py
@@ -460,6 +460,13 @@ def _parse(reader, in_block=None):
if reader[curly + 1] not in ("{", "%"):
curly += 1
continue
+ # When there are more than 2 curlies in a row, use the
+ # innermost ones. This is useful when generating languages
+ # like latex where curlies are also meaningful
+ if (curly + 2 < reader.remaining() and
+ reader[curly + 1] == '{' and reader[curly + 2] == '{'):
+ curly += 1
+ continue
break
# Append any text before the special token
Please sign in to comment.
Something went wrong with that request. Please try again.