Hi,

I noticed that some of the default tags use token.split_contents() to
parse their arguments, while others use token.contents.split(). At
first glance, it seems that split_contents() is the smarter way to go,
because it knows about quoted strings. Alas, there's a problem with
filters. For example, this works:

{% for x in "somestring"|somefilter %}
{% endfor %}

while this doesn't:

{% with "somestring"|somefilter as x %}
{% endwith %}

That's because "for" uses token.contents.split() and "with" uses
token.split_contents(), which splits before the pipe. Of course, if
there was a space in "somestring", "for" would break.

Shouldn't split_contents() be modified to know about filters? And
shouldn't all the tags use the same method for splitting their
parameters? Or am I missing something here?

Regards.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to