diff --git a/doc/build/unreleased/412.rst b/doc/build/unreleased/412.rst new file mode 100644 index 0000000..3ee9bb6 --- /dev/null +++ b/doc/build/unreleased/412.rst @@ -0,0 +1,8 @@ +.. change:: + :tags: bug, lexer + :tickets: 412 + + Fixed long standing bug where the sequence ``<&`` would be misinterpreted + by the lexer. It's not clear why the ampersand character was part of the + characters being consumed here and it may have been an inadvertent bit of + code from one of Mako's predecessor languages. diff --git a/mako/lexer.py b/mako/lexer.py index 9d1f5f3..b4a76a4 100644 --- a/mako/lexer.py +++ b/mako/lexer.py @@ -375,7 +375,7 @@ def match_text(self): | (?=\${) # an expression | - (?=; + +""" + nodes = Lexer(template).parse() + self._compare( + nodes, + TemplateNode({}, [Text("\nproperty = <&node>;\n\n", (1, 1))]), + ) + def _dont_test_dict_expression_issue_400(self): """test for issue #400""" template = """