Index: tests/regressiontests/defaultfilters/tests.py
===================================================================
--- tests/regressiontests/defaultfilters/tests.py (revision 16251)
+++ tests/regressiontests/defaultfilters/tests.py (working copy)
@@ -212,10 +212,14 @@
u'djangoproject.org')
self.assertEqual(urlize('info@djangoproject.org'),
u'info@djangoproject.org')
-
+
# Check urlize with https addresses
self.assertEqual(urlize('https://google.com'),
u'https://google.com')
+ # Check with escaped characters
+ self.assertEqual(urlize('http://google.com/django%20project'),
+ u'http://google.com/django%20project')
+
def test_wordcount(self):
self.assertEqual(wordcount(''), 0)
Index: django/utils/html.py
===================================================================
--- django/utils/html.py (revision 16251)
+++ django/utils/html.py (working copy)
@@ -129,11 +129,11 @@
# Make URL we want to point to.
url = None
if middle.startswith('http://') or middle.startswith('https://'):
- url = urlquote(middle, safe='/&=:;#?+*')
+ url = urlquote(middle, safe='/&=:;#?+*%')
elif middle.startswith('www.') or ('@' not in middle and \
middle and middle[0] in string.ascii_letters + string.digits and \
(middle.endswith('.org') or middle.endswith('.net') or middle.endswith('.com'))):
- url = urlquote('http://%s' % middle, safe='/&=:;#?+*')
+ url = urlquote('http://%s' % middle, safe='/&=:;#?+*%')
elif '@' in middle and not ':' in middle and simple_email_re.match(middle):
url = 'mailto:%s' % middle
nofollow_attr = ''