Skip to content
Myr

lstrip spaces (but not newlines) from block tags

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kristi Tsukida · committed by Kristi Tsukida · parent 6327f79 · Browse files · 1 file+6 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−2 removed

  • other:+6 added−2 removed

1 file+6 added−2 removed

modified:jinja2/lexer.py+6 added-2 removed
422 unmodified lines
423 root_tag_rules = compile_rules(environment)424425 # block suffix if trimming is enabled426 block_suffix_re = environment.trim_blocks and '\\n?' or ''427 # TODO hook environment setting428 block_prefix_re = True and '[ \\t]*' or ''429430 self.newline_sequence = environment.newline_sequence431432 # global lexing rules433 self.rules = {434 'root': [435 # directives436 (c('(.*?)(?:%s)' % '|'.join(435 [r'(?P<raw_begin>(?:\s*%s\-|%s)\s*raw\s*(?:\-%s\s*|%s))' % (437 [r'(?P<raw_begin>(?:\s*%s\-|%s%s)\s*raw\s*(?:\-%s\s*|%s))' % (438 e(environment.block_start_string),439 block_prefix_re,440 e(environment.block_start_string),441 e(environment.block_end_string),442 e(environment.block_end_string)443 )] + [
28 unmodified lines
472 )), TOKEN_VARIABLE_END, '#pop')473 ] + tag_rules,474 # raw block475 TOKEN_RAW_BEGIN: [473 (c('(.*?)((?:\s*%s\-|%s)\s*endraw\s*(?:\-%s\s*|%s%s))' % (476 (c('(.*?)((?:\s*%s\-|%s%s)\s*endraw\s*(?:\-%s\s*|%s%s))' % (477 e(environment.block_start_string),478 block_prefix_re,479 e(environment.block_start_string),480 e(environment.block_end_string),481 e(environment.block_end_string),482 block_suffix_re
203 unmodified lines