]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Merge branch '2.11.x'
authorDavid Lord <davidism@gmail.com>
Mon, 30 Mar 2020 18:40:59 +0000 (11:40 -0700)
committerDavid Lord <davidism@gmail.com>
Mon, 30 Mar 2020 18:40:59 +0000 (11:40 -0700)
1  2 
CHANGES.rst
src/jinja2/lexer.py
src/jinja2/utils.py
tests/test_async.py
tests/test_lexnparse.py

diff --cc CHANGES.rst
Simple merge
Simple merge
Simple merge
Simple merge
index d14a6ccba6663da5d3a5bb3c68b6cf5f839308e2,3355791a0c328659bd3231b8baf7e5392d8de6ab..6057416971c9c9f4df9f8bbdd51a505e2b23d4f6
@@@ -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(
+             """\
+ <html>
+     <body>
+     {%- block content -%}
+         <hr>
+         {{ item }}
+     {% endblock %}
+     </body>
+ </html>"""
+         )
+         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(