|
@@ -305,6 +305,28 @@ class FunctionTests(SimpleTestCase):
|
|
|
"http://testing.com/example</a>.,:;)"!",
|
|
|
)
|
|
|
|
|
|
+ def test_trailing_semicolon(self):
|
|
|
+ self.assertEqual(
|
|
|
+ urlize("http://example.com?x=&", autoescape=False),
|
|
|
+ '<a href="http://example.com?x=" rel="nofollow">'
|
|
|
+ "http://example.com?x=&</a>",
|
|
|
+ )
|
|
|
+ self.assertEqual(
|
|
|
+ urlize("http://example.com?x=&;", autoescape=False),
|
|
|
+ '<a href="http://example.com?x=" rel="nofollow">'
|
|
|
+ "http://example.com?x=&</a>;",
|
|
|
+ )
|
|
|
+ self.assertEqual(
|
|
|
+ urlize("http://example.com?x=&;;", autoescape=False),
|
|
|
+ '<a href="http://example.com?x=" rel="nofollow">'
|
|
|
+ "http://example.com?x=&</a>;;",
|
|
|
+ )
|
|
|
+ self.assertEqual(
|
|
|
+ urlize("http://example.com?x=&.;...;", autoescape=False),
|
|
|
+ '<a href="http://example.com?x=" rel="nofollow">'
|
|
|
+ "http://example.com?x=&</a>.;...;",
|
|
|
+ )
|
|
|
+
|
|
|
def test_brackets(self):
|
|
|
"""
|
|
|
#19070 - Check urlize handles brackets properly
|