Mercurial > genshi > mirror
diff genshi/template/text.py @ 365:4f431931d64e trunk
Fix for #62: preserve whitespace in front of directives.
author | cmlenz |
---|---|
date | Wed, 22 Nov 2006 20:48:35 +0000 |
parents | fe40d34fb71d |
children | b146277eb54a |
line wrap: on
line diff
--- a/genshi/template/text.py +++ b/genshi/template/text.py @@ -50,7 +50,9 @@ ('choose', ChooseDirective), ('with', WithDirective)] - _DIRECTIVE_RE = re.compile(r'^\s*(?<!\\)#((?:\w+|#).*)\n?', re.MULTILINE) + _DIRECTIVE_RE = re.compile(r'(?:^[ \t]*(?<!\\)#(end).*\n?)|' + r'(?:^[ \t]*(?<!\\)#((?:\w+|#).*)\n?)', + re.MULTILINE) def _parse(self, encoding): """Parse the template from text input."""