Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #18644 -- Made urlize trim trailing period followed by parenthesis

  • Loading branch information...
commit d5012d6371e804fc0427112cc1ceacbe8a059c4f 1 parent 29132eb
@ljosa ljosa authored
View
2  django/utils/html.py
@@ -13,7 +13,7 @@
from django.utils.text import normalize_newlines
# Configuration for urlize() function.
-TRAILING_PUNCTUATION = ['.', ',', ':', ';']
+TRAILING_PUNCTUATION = ['.', ',', ':', ';', '.)']
WRAPPING_PUNCTUATION = [('(', ')'), ('<', '>'), ('&lt;', '&gt;')]
# List of possible strings used for bullets in bulleted lists.
View
4 tests/regressiontests/defaultfilters/tests.py
@@ -297,6 +297,10 @@ def test_urlize(self):
self.assertEqual(urlize('HTTPS://github.com/'),
'<a href="https://github.com/" rel="nofollow">HTTPS://github.com/</a>')
+ # Check urlize trims trailing period when followed by parenthesis - see #18644
+ self.assertEqual(urlize('(Go to http://www.example.com/foo.)'),
+ '(Go to <a href="http://www.example.com/foo" rel="nofollow">http://www.example.com/foo</a>.)')
+
def test_wordcount(self):
self.assertEqual(wordcount(''), 0)
self.assertEqual(wordcount('oneword'), 1)
Please sign in to comment.
Something went wrong with that request. Please try again.