From 367ce0ce923d4efe114f65300d2f4668cf7fbd4d Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Sat, 12 Nov 2005 21:45:01 +0000 Subject: [PATCH] fixes #764 - the TokenParser now respects string parameters to filters that contain blanks. git-svn-id: http://code.djangoproject.com/svn/django/trunk@1207 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/template/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/django/core/template/__init__.py b/django/core/template/__init__.py index a501d6bbe8b..c007e4bc80d 100644 --- a/django/core/template/__init__.py +++ b/django/core/template/__init__.py @@ -301,6 +301,13 @@ class TokenParser: else: p = i while i < len(subject) and subject[i] not in (' ', '\t'): + if subject[i] in ('"', "'"): + c = subject[i] + i += 1 + while i < len(subject) and subject[i] != c: + i += 1 + if i >= len(subject): + raise TemplateSyntaxError, "Searching for value. Unexpected end of string in column %d: %s" % subject i += 1 s = subject[p:i] while i < len(subject) and subject[i] in (' ', '\t'):