Permalink
Browse files

Handle quoted strings (for multi-word titles)

  • Loading branch information...
ericflo committed Apr 14, 2009
1 parent 5bbd21a commit 62cbdabdb0622b5531a6cf15b748042d298eb4a5
Showing with 2 additions and 2 deletions.
  1. +2 −2 django_sorting/templatetags/sorting_tags.py
@@ -19,7 +19,7 @@ def anchor(parser, token):
"""
Parses a tag that's supposed to be in this format: {% anchor field title %}
"""
- bits = token.contents.split()
+ bits = [b.strip('"\'') for b in token.split_contents()]
if len(bits) < 2:
raise TemplateSyntaxError, "anchor tag takes at least 1 argument"
try:
@@ -77,7 +77,7 @@ def render(self, context):
def autosort(parser, token):
- bits = token.contents.split()
+ bits = [b.strip('"\'') for b in token.split_contents()]
if len(bits) != 2:
raise TemplateSyntaxError, "autosort tag takes exactly one argument"
return SortedDataNode(bits[1])

0 comments on commit 62cbdab

Please sign in to comment.