Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added urlencode filter, fix for issue #17 #62

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@gfuchedzhy
Copy link

gfuchedzhy commented Oct 1, 2011

No description provided.

@snoack

This comment has been minimized.

Copy link
Contributor

snoack commented on jinja2/filters.py in 37303a8 Oct 28, 2011

Why do you call the filter urlencode if its actually urllib.quote, not urllib.urlencode?

This comment has been minimized.

Copy link

gfuchedzhy replied Oct 28, 2011

because it was called this way in jinja-1

@mitsuhiko

This comment has been minimized.

Copy link
Member

mitsuhiko commented on 37303a8 Nov 2, 2011

This is not unicode safe. If we would integrate such a filter we would have to select a default encoding. Not sure what to do there. Maybe force UTF-8 on everybody.

This comment has been minimized.

Copy link
Contributor

snoack replied Nov 2, 2011

I also don't like the plus argument, because of that makes the choice whether to use the plus-variant or not up to the template author. But your application might require that all urls are quoted the same certain way.

In my opinion it would be appropriate to leave the implementation of that filter to the user, instead of providing a default implementation that either makes decisions (about the encoding and whether or not to use the plus-variant) for the user or requires them as argument, each time the filter is used.

@snoack

This comment has been minimized.

Copy link
Contributor

snoack commented on jinja2/filters.py in 37303a8 Nov 2, 2011

The ... if ... else ... syntax isn't compatible with Python 2.4.

@mitsuhiko

This comment has been minimized.

Copy link
Member

mitsuhiko commented May 19, 2013

Duplicate, already implemented.

@mitsuhiko mitsuhiko closed this May 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.