1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Updated urlize regex following a93ee5112d

Prevent urlize from turning some.organization, an.intern etc.
into urls. Refs #22941.
This commit is contained in:
LarryBrid
2014-07-03 16:37:56 -04:00
committed by Claude Paroz
parent 814bcc3395
commit 1bb1d3168b
2 changed files with 3 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ DOTS = ['·', '*', '\u2022', '•', '•', '•']
unencoded_ampersands_re = re.compile(r'&(?!(\w+|#\d+);)')
word_split_re = re.compile(r'(\s+)')
simple_url_re = re.compile(r'^https?://\[?\w', re.IGNORECASE)
simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org)(.*)$', re.IGNORECASE)
simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org)($|/.*)$', re.IGNORECASE)
simple_email_re = re.compile(r'^\S+@\S+\.\S+$')
link_target_attribute_re = re.compile(r'(<a [^>]*?)target=[^\s>]+')
html_gunk_re = re.compile(r'(?:<br clear="all">|<i><\/i>|<b><\/b>|<em><\/em>|<strong><\/strong>|<\/?smallcaps>|<\/?uppercase>)', re.IGNORECASE)