Ticket #7355: urlize-https-fix-tests.diff
File urlize-https-fix-tests.diff, 1.3 KB (added by , 16 years ago) |
---|
-
tests/regressiontests/defaultfilters/tests.py
166 166 >>> urlizetrunc(uri, 2) 167 167 u'<a href="http://31characteruri.com/test/" rel="nofollow">...</a>' 168 168 169 # Check normal urlize 170 >>> url = 'https://google.com' 171 >>> urlize(url) 172 u'<a href="https://google.com" rel="nofollow">https://google.com</a>' 173 169 174 >>> wordcount('') 170 175 0 171 176 -
django/utils/html.py
99 99 lead, middle, trail = match.groups() 100 100 if safe_input: 101 101 middle = mark_safe(middle) 102 if middle.startswith('www.') or ('@' not in middle and not middle.startswith('http://') and \102 if middle.startswith('www.') or ('@' not in middle and not (middle.startswith('http://') or middle.startswith('https://')) and \ 103 103 len(middle) > 0 and middle[0] in string.ascii_letters + string.digits and \ 104 104 (middle.endswith('.org') or middle.endswith('.net') or middle.endswith('.com'))): 105 105 middle = 'http://%s' % middle