File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,16 @@ def test_url_parentheses(self):
57
57
self .assertEqual (result .html , u'text (<a href="http://example.com">http://example.com</a>)' )
58
58
self .assertEqual (result .urls , [u'http://example.com' ])
59
59
60
+ def test_url_underscore (self ):
61
+ result = self .parser .parse (u'text http://example.com/test/foo_123.jpg' )
62
+ self .assertEqual (result .html , u'text <a href="http://example.com/test/foo_123.jpg">http://example.com/test/foo...</a>' )
63
+ self .assertEqual (result .urls , [u'http://example.com/test/foo_123.jpg' ])
64
+
65
+ def test_url_underscore_dot (self ):
66
+ result = self .parser .parse (u'text http://example.com/test/bla.net_foo_123.jpg' )
67
+ self .assertEqual (result .html , u'text <a href="http://example.com/test/bla.net_foo_123.jpg">http://example.com/test/bla...</a>' )
68
+ self .assertEqual (result .urls , [u'http://example.com/test/bla.net_foo_123.jpg' ])
69
+
60
70
def test_url_amp_lang_equals (self ):
61
71
result = self .parser .parse (u'Check out http://search.twitter.com/search?q=avro&lang=en' )
62
72
self .assertEqual (result .html , u'Check out <a href="http://search.twitter.com/search?q=avro&lang=en">http://search.twitter.com/s...</a>' )
Original file line number Diff line number Diff line change 45
45
46
46
# URLs
47
47
PRE_CHARS = ur'(?:[^/"\':!=]|^|\:)'
48
- DOMAIN_CHARS = ur'([\.-]|[^\s_\!\.])+\.[a-z]{2,}(?::[0-9]+)?'
48
+ DOMAIN_CHARS = ur'([\.-]|[^\s_\!\.\/ ])+\.[a-z]{2,}(?::[0-9]+)?'
49
49
PATH_CHARS = ur'(?:[\.,]?[%s!\*\'\(\);:=\+\$/%s#\[\]\-_,~@])' % (UTF_CHARS , '%' )
50
50
QUERY_CHARS = ur'[a-z0-9!\*\'\(\);:&=\+\$/%#\[\]\-_\.,~]'
51
51
You can’t perform that action at this time.
0 commit comments