Changeset 7701
- Timestamp:
- 06/19/08 07:05:39 (3 months ago)
- Files:
-
- django/trunk/django/utils/html.py (modified) (1 diff)
- django/trunk/tests/regressiontests/defaultfilters/tests.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/utils/html.py
r7079 r7701 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'))): django/trunk/tests/regressiontests/defaultfilters/tests.py
r7575 r7701 167 167 u'<a href="http://31characteruri.com/test/" rel="nofollow">...</a>' 168 168 169 # Check normal urlize 170 >>> urlize('http://google.com') 171 u'<a href="http://google.com" rel="nofollow">http://google.com</a>' 172 173 >>> urlize('http://google.com/') 174 u'<a href="http://google.com/" rel="nofollow">http://google.com/</a>' 175 176 >>> urlize('www.google.com') 177 u'<a href="http://www.google.com" rel="nofollow">http://www.google.com</a>' 178 179 >>> urlize('djangoproject.org') 180 u'<a href="http://djangoproject.org" rel="nofollow">http://djangoproject.org</a>' 181 182 >>> urlize('info@djangoproject.org') 183 u'<a href="mailto:info@djangoproject.org">info@djangoproject.org</a>' 184 185 # Check urlize with https addresses 186 >>> urlize('https://google.com') 187 u'<a href="https://google.com" rel="nofollow">https://google.com</a>' 188 189 169 190 >>> wordcount('') 170 191 0
