Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #216 from ljosa/ticket_18644

Fixed #18644 -- Made urlize trim trailing period followed by parenthesis
  • Loading branch information...
commit 59d99772f0e3c69bc1824ce1e76438d89c50c9b9 2 parents 51a0101 + d5012d6
@apollo13 apollo13 authored
View
2  django/utils/html.py
@@ -17,7 +17,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
@@ -298,6 +298,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.