mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #26193 -- Made urlize() trim multiple trailing punctuation.
This commit is contained in:
parent
fcd08c1757
commit
dec334cb66
2 changed files with 58 additions and 13 deletions
|
@ -246,6 +246,24 @@ class FunctionTests(SimpleTestCase):
|
|||
'(Go to <a href="http://www.example.com/foo" rel="nofollow">http://www.example.com/foo</a>.)',
|
||||
)
|
||||
|
||||
def test_trailing_multiple_punctuation(self):
|
||||
self.assertEqual(
|
||||
urlize('A test http://testing.com/example..'),
|
||||
'A test <a href="http://testing.com/example" rel="nofollow">http://testing.com/example</a>..'
|
||||
)
|
||||
self.assertEqual(
|
||||
urlize('A test http://testing.com/example!!'),
|
||||
'A test <a href="http://testing.com/example" rel="nofollow">http://testing.com/example</a>!!'
|
||||
)
|
||||
self.assertEqual(
|
||||
urlize('A test http://testing.com/example!!!'),
|
||||
'A test <a href="http://testing.com/example" rel="nofollow">http://testing.com/example</a>!!!'
|
||||
)
|
||||
self.assertEqual(
|
||||
urlize('A test http://testing.com/example.,:;)"!'),
|
||||
'A test <a href="http://testing.com/example" rel="nofollow">http://testing.com/example</a>.,:;)"!'
|
||||
)
|
||||
|
||||
def test_brackets(self):
|
||||
"""
|
||||
#19070 - Check urlize handles brackets properly
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue