- [bug] Fixed issue where an old lexer rule prevented a template line which looked like "#*" from being correctly parsed. [ticket:224]
diff --git a/CHANGES b/CHANGES index 0bd875e..df6a486 100644 --- a/CHANGES +++ b/CHANGES
@@ -7,6 +7,9 @@ instead of ``# -*- encoding:%s -*-``; the former is more common and compatible with emacs. Courtesy Martin Geisler. +- [bug] Fixed issue where an old lexer rule prevented a template line + which looked like "#*" from being correctly parsed. [ticket:224] + 0.9.0 - [bug] The Context.locals_() method becomes a private underscored method, as this method has a specific internal use. The purpose
diff --git a/mako/lexer.py b/mako/lexer.py index 034caf7..42b9ecd 100644 --- a/mako/lexer.py +++ b/mako/lexer.py
@@ -345,8 +345,6 @@ | (?=\${) # an expression | - (?=\#\*) # multiline comment - | (?=</?[%&]) # a substitution or block or call start or end # - don't consume |
diff --git a/test/test_lexer.py b/test/test_lexer.py index 3076de4..3e97bef 100644 --- a/test/test_lexer.py +++ b/test/test_lexer.py
@@ -155,6 +155,12 @@ ControlLine('if', 'endif', True, (7, 1)), Text(' ', (8, 1))])) + def test_old_multiline_comment(self): + template = """#*""" + node = Lexer(template).parse() + self._compare(node, TemplateNode({}, [Text('''#*''', (1, 1))])) + + def test_text_tag(self): template = \ """