mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Reverted parts of r17359 that could cause false positives in URL detection, especially on file names.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17364 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -21,7 +21,7 @@ unencoded_ampersands_re = re.compile(r'&(?!(\w+|#\d+);)')
|
||||
unquoted_percents_re = re.compile(r'%(?![0-9A-Fa-f]{2})')
|
||||
word_split_re = re.compile(r'(\s+)')
|
||||
simple_url_re = re.compile(r'^https?://\w')
|
||||
simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org|[a-z]{2})$')
|
||||
simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org)$')
|
||||
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)
|
||||
@@ -125,10 +125,9 @@ def urlize(text, trim_url_limit=None, nofollow=False, autoescape=False):
|
||||
Converts any URLs in text into clickable links.
|
||||
|
||||
Works on http://, https://, www. links, and also on links ending in one of
|
||||
the original seven gTLDs (.com, .edu, .gov, .int, .mil, .net, and .org) or
|
||||
a two-letter ccTLD. Links can have trailing punctuation (periods, commas,
|
||||
close-parens) and leading punctuation (opening parens) and it'll still do
|
||||
the right thing.
|
||||
the original seven gTLDs (.com, .edu, .gov, .int, .mil, .net, and .org).
|
||||
Links can have trailing punctuation (periods, commas, close-parens) and
|
||||
leading punctuation (opening parens) and it'll still do the right thing.
|
||||
|
||||
If trim_url_limit is not None, the URLs in link text longer than this limit
|
||||
will truncated to trim_url_limit-3 characters and appended with an elipsis.
|
||||
|
||||
Reference in New Issue
Block a user