From: David Lord Date: Mon, 30 Mar 2020 18:40:59 +0000 (-0700) Subject: Merge branch '2.11.x' X-Git-Tag: 3.0.0rc1~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a370316c6a4f0d034da5f90df5a671a32a8e376;p=thirdparty%2Fjinja.git Merge branch '2.11.x' --- 0a370316c6a4f0d034da5f90df5a671a32a8e376 diff --cc tests/test_lexnparse.py index d14a6ccb,3355791a..60574169 --- a/tests/test_lexnparse.py +++ b/tests/test_lexnparse.py @@@ -163,8 -178,26 +163,26 @@@ class TestLexer else: pytest.raises(TemplateSyntaxError, env.from_string, t) + def test_lineno_with_strip(self, env): + tokens = env.lex( + """\ + + + {%- block content -%} +
+ {{ item }} + {% endblock %} + + """ + ) + for tok in tokens: + lineno, token_type, value = tok + if token_type == "name" and value == "item": + assert lineno == 5 + break + -class TestParser(object): +class TestParser: def test_php_syntax(self, env): env = Environment("", "", "") tmpl = env.from_string(