]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Enable leading whitespace stripping for blocks
authorKevin Brown <kevin@kevin-brown.com>
Sat, 9 May 2020 03:17:40 +0000 (23:17 -0400)
committerKevin <kevin@kevin-brown.com>
Sun, 10 May 2020 01:50:06 +0000 (21:50 -0400)
tatsu_grammar.txt
test_template.jinja

index 2774e6d40076de8457ba73a9ce84892d305aab59..8195fe0deb1b3a5056dee371c2a2a1e8ba42920a 100644 (file)
@@ -55,7 +55,8 @@ block_end
 \r
 block_open\r
     =\r
-    @:"{%" {SP}*\r
+    | @:"{%" {SP}*\r
+    | {SP}* @:"{%-" {SP}*\r
     ;\r
 \r
 block_close\r
index e77c6081136679d0a8dec872fe85e128e7bf2c88..6d8129ca0f81dcc1d0697e52823bc56691863e8a 100644 (file)
@@ -31,10 +31,10 @@ across lines #}
         The value will increase even more!\r
     {% endif %}\r
 {% endfor %}\r
-{% macro textarea(name, value='', rows=10, cols=40) -%}\r
+{%- macro textarea(name, value='', rows=10, cols=40) -%}\r
     <textarea name="{{ name }}" rows="{{ rows }}" cols="{{ cols\r
         }}">{{ value|e }}</textarea>\r
-{% endmacro -%}\r
+{%- endmacro -%}\r
 {# comment contents\r
 across lines #}\r
 <ul>\r