diff --git a/django/template/base.py b/django/template/base.py
index e2fc66b..97d22f3 100644
a
|
b
|
constant_string = constant_string.replace("\n", "")
|
486 | 486 | filter_raw_string = r""" |
487 | 487 | ^(?P<constant>%(constant)s)| |
488 | 488 | ^(?P<var>[%(var_chars)s]+|%(num)s)| |
489 | | (?:%(filter_sep)s |
| 489 | (?:\s*%(filter_sep)s\s* |
490 | 490 | (?P<filter_name>\w+) |
491 | 491 | (?:%(arg_sep)s |
492 | 492 | (?: |
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 9b6f8d4..3d26dad 100644
a
|
b
|
class Templates(unittest.TestCase):
|
634 | 634 | # Chained filters |
635 | 635 | 'filter-syntax02': ("{{ var|upper|lower }}", {"var": "Django is the greatest!"}, "django is the greatest!"), |
636 | 636 | |
637 | | # Raise TemplateSyntaxError for space between a variable and filter pipe |
638 | | 'filter-syntax03': ("{{ var |upper }}", {}, template.TemplateSyntaxError), |
| 637 | # Allow spaces before the filter pipe |
| 638 | 'filter-syntax03': ("{{ var |upper }}", {"var": "Django is the greatest!"}, "DJANGO IS THE GREATEST!"), |
639 | 639 | |
640 | | # Raise TemplateSyntaxError for space after a filter pipe |
641 | | 'filter-syntax04': ("{{ var| upper }}", {}, template.TemplateSyntaxError), |
| 640 | # Allow spaces after the filter pipe |
| 641 | 'filter-syntax04': ("{{ var| upper }}", {"var": "Django is the greatest!"}, "DJANGO IS THE GREATEST!"), |
642 | 642 | |
643 | 643 | # Raise TemplateSyntaxError for a nonexistent filter |
644 | 644 | 'filter-syntax05': ("{{ var|does_not_exist }}", {}, template.TemplateSyntaxError), |