Commits

Andriy Kornatskyy committed c8cf377

Improved whitespace extesion for wheezy.template.

Comments (0)

Files changed (2)

src/wheezy/html/ext/template.py

             r''),
         (re.compile(r'^ \s+', re.MULTILINE),
             r''),
-        (re.compile(r'>\s+$', re.MULTILINE),
-            r'>'),
+        (re.compile(r'\s+$', re.MULTILINE),
+            r''),
         (re.compile(r'>\n@def'),
             r'>\\\n@def'),
         (re.compile(r'(?<!:|\\)\n@end'),

src/wheezy/html/ext/tests/test_template.py

     def test_whitespace(self):
         """
         """
-        assert '><' == self.preprocess('  >  <')
+        assert '><' == self.preprocess('  >  < ')
         assert '' == self.preprocess('  ')
         assert 'x' == self.preprocess('  x')
+        assert 'x' == self.preprocess('x  ')
         assert '>' == self.preprocess('>  ')
         assert '>\\\n@def' == self.preprocess('>\n@def')
         assert '>\\\n@end' == self.preprocess('>\n@end')