From: Alek Storm Date: Wed, 3 Aug 2011 08:25:31 +0000 (+0000) Subject: Allow template directives to span multiple lines X-Git-Tag: v2.2.0~67^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c95be878beec2602e1108a0ba43c539750cec27e;p=thirdparty%2Ftornado.git Allow template directives to span multiple lines --- diff --git a/tornado/template.py b/tornado/template.py index cece87e53..99a308c04 100644 --- a/tornado/template.py +++ b/tornado/template.py @@ -579,7 +579,7 @@ def _parse(reader, template, in_block=None): # Expression if start_brace == "{{": end = reader.find("}}") - if end == -1 or reader.find("\n", 0, end) != -1: + if end == -1: raise ParseError("Missing end expression }} on line %d" % line) contents = reader.consume(end).strip() reader.consume(2) @@ -591,7 +591,7 @@ def _parse(reader, template, in_block=None): # Block assert start_brace == "{%", start_brace end = reader.find("%}") - if end == -1 or reader.find("\n", 0, end) != -1: + if end == -1: raise ParseError("Missing end block %%} on line %d" % line) contents = reader.consume(end).strip() reader.consume(2)