Make url_with_query() sort parameters.

This commit is contained in:
Neil Schemenauer 2016-10-04 12:55:22 -07:00
parent 7a7abbc30a
commit 7dc58b8c88
1 changed files with 2 additions and 1 deletions

View File

@ -77,8 +77,9 @@ def href(url, text, title=None, **attrs):
def url_with_query(path, **attrs):
result = htmltext(url_quote(path))
if attrs:
attrs = sorted(attrs.items())
result += "?" + "&".join([url_quote(key) + "=" + url_quote(value)
for key, value in attrs.items()])
for key, value in attrs])
return result
def nl2br(value):