Loading django/utils/html.py +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ from django.utils.text import normalize_newlines # Configuration for urlize() function. TRAILING_PUNCTUATION = ['.', ',', ':', ';', '.)'] WRAPPING_PUNCTUATION = [('(', ')'), ('<', '>'), ('<', '>')] WRAPPING_PUNCTUATION = [('(', ')'), ('<', '>'), ('[', ']'), ('<', '>')] # List of possible strings used for bullets in bulleted lists. DOTS = ['·', '*', '\u2022', '•', '•', '•'] Loading tests/regressiontests/defaultfilters/tests.py +6 −1 Original line number Diff line number Diff line Loading @@ -306,6 +306,11 @@ class DefaultFiltersTests(TestCase): 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>.)') # Check urlize doesn't crash when square bracket is appended to url (#19070) self.assertEqual(urlize('[see www.example.com]'), '[see <a href="http://www.example.com" rel="nofollow">www.example.com</a>]' ) def test_wordcount(self): self.assertEqual(wordcount(''), 0) self.assertEqual(wordcount('oneword'), 1) Loading Loading
django/utils/html.py +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ from django.utils.text import normalize_newlines # Configuration for urlize() function. TRAILING_PUNCTUATION = ['.', ',', ':', ';', '.)'] WRAPPING_PUNCTUATION = [('(', ')'), ('<', '>'), ('<', '>')] WRAPPING_PUNCTUATION = [('(', ')'), ('<', '>'), ('[', ']'), ('<', '>')] # List of possible strings used for bullets in bulleted lists. DOTS = ['·', '*', '\u2022', '•', '•', '•'] Loading
tests/regressiontests/defaultfilters/tests.py +6 −1 Original line number Diff line number Diff line Loading @@ -306,6 +306,11 @@ class DefaultFiltersTests(TestCase): 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>.)') # Check urlize doesn't crash when square bracket is appended to url (#19070) self.assertEqual(urlize('[see www.example.com]'), '[see <a href="http://www.example.com" rel="nofollow">www.example.com</a>]' ) def test_wordcount(self): self.assertEqual(wordcount(''), 0) self.assertEqual(wordcount('oneword'), 1) Loading