From: Ben Darnell Date: Thu, 18 Mar 2010 01:48:32 +0000 (-0700) Subject: Allow more than two consecutive curlies to appear in templates (and use X-Git-Tag: v1.0.0~73^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fca7c831341b864916c6c97bdbdb2f95d95b2c12;p=thirdparty%2Ftornado.git Allow more than two consecutive curlies to appear in templates (and use the innermost). This was previously a syntax error in the generated python. --- diff --git a/tornado/template.py b/tornado/template.py index eafee778f..b5e94bda7 100644 --- a/tornado/template.py +++ b/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