diff --git a/zephyr/tests.py b/zephyr/tests.py index 7b89776fb4..06754a00e5 100644 --- a/zephyr/tests.py +++ b/zephyr/tests.py @@ -1831,7 +1831,12 @@ int x = 3 ('from http://supervisord.org/running.html:', "
from %s:
", 'http://supervisord.org/running.html'), ('http://raven.io', "%s
", 'http://raven.io'), ('at https://humbughq.com/api. Check it!', "at %s. Check it!
", 'https://humbughq.com/api'), - ('goo.gl/abc', "%s
", 'goo.gl/abc'), + ('goo.gl/abc', "%s
", 'goo.gl/abc'), + ('http://d.pr/i/FMXO', "%s
", 'http://d.pr/i/FMXO'), + ('http://fmota.eu/blog/test.html', "%s
", 'http://fmota.eu/blog/test.html'), + ('http://j.mp/14Hwm3X', "%s
", 'http://j.mp/14Hwm3X'), + ('http://localhost:9991/?show_debug=1', "%s
", 'http://localhost:9991/?show_debug=1'), + ('anyone before? (http://d.pr/i/FMXO)', "anyone before? (%s)
", 'http://d.pr/i/FMXO'), # XSS Sanitization ('javascript:alert(\'hi\');.com', "%s
", None), # None marks xss @@ -1844,6 +1849,8 @@ int x = 3 ('http://example.com/something?with,commas,in,url, but not at end', "%s, but not at end
", 'http://example.com/something?with,commas,in,url'), + ('http://www.yelp.com/biz/taim-mobile-falafel-and-smoothie-truck-new-york#query', + "%s
", 'http://www.yelp.com/biz/taim-mobile-falafel-and-smoothie-truck-new-york#query'), (' some text https://www.google.com/baz_(match)?with=foo&bar=baz with extras', "some text %s with extras
", 'https://www.google.com/baz_(match)?with=foo&bar=baz'), ('hash it http://foo.com/blah_(wikipedia)_blah#cite-1', @@ -1860,6 +1867,17 @@ int x = 3 converted = convert(inline_url) self.assertEqual(match, converted) + def test_linkify_interference(self): + # Check our auto links don't interfere with normal markdown linkification + msg = 'link: xx, x xxxxx xx xxxx xx\n\n[xxxxx #xx](xxxx://xxxxxxxxx:xxxx/xxx/xxxxxx%xxxxxx/xx/):\ +**xxxxxxx**\n\nxxxxxxx xxxxx xxxx xxxxx:\n`xxxxxx`: xxxxxxx\n`xxxxxx`: xxxxx\n`xxxxxx`: xxxxx xxxxx' + converted = convert(msg) + + self.assertEqual(converted, 'link: xx, x xxxxx xx xxxx xx
\nxxxxx #xx:\ +xxxxxxx
\nxxxxxxx xxxxx xxxx xxxxx:
\nxxxxxx: xxxxxxx
\nxxxxxx: xxxxx\
+
\nxxxxxx: xxxxx xxxxx