Ticket #18071: urlize.patch

File urlize.patch, 942 bytes (added by luke@…, 12 years ago)

patch to make url regex case insensitive

  • django/utils/html.py

    diff --git django/utils/html.py django/utils/html.py
    index 78359f9..6760f7a 100644
    DOTS = [u'·', u'*', u'\u2022', u'•', u'•', u'•']  
    2020unencoded_ampersands_re = re.compile(r'&(?!(\w+|#\d+);)')
    2121unquoted_percents_re = re.compile(r'%(?![0-9A-Fa-f]{2})')
    2222word_split_re = re.compile(r'(\s+)')
    23 simple_url_re = re.compile(r'^https?://\w')
    24 simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org)$')
     23simple_url_re = re.compile(r'^https?://\w', re.IGNORECASE)
     24simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org)$', re.IGNORECASE)
    2525simple_email_re = re.compile(r'^\S+@\S+\.\S+$')
    2626link_target_attribute_re = re.compile(r'(<a [^>]*?)target=[^\s>]+')
    2727html_gunk_re = re.compile(r'(?:<br clear="all">|<i><\/i>|<b><\/b>|<em><\/em>|<strong><\/strong>|<\/?smallcaps>|<\/?uppercase>)', re.IGNORECASE)
Back to Top