Loading django/utils/html.py +1 −1 Original line number Diff line number Diff line Loading @@ -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) Loading docs/ref/templates/builtins.txt +6 −0 Original line number Diff line number Diff line Loading @@ -2277,6 +2277,12 @@ It also supports domain-only links ending in one of the original top level domains (``.com``, ``.edu``, ``.gov``, ``.int``, ``.mil``, ``.net``, and ``.org``). For example, ``djangoproject.com`` gets converted. .. versionchanged:: 1.8 Support for domain-only links that include characters after the top-level domain (e.g. ``djangoproject.com/`` and ``djangoproject.com/download/``) was added. Links can have trailing punctuation (periods, commas, close-parens) and leading punctuation (opening parens), and ``urlize`` will still do the right thing. Loading docs/releases/1.8.txt +3 −1 Original line number Diff line number Diff line Loading @@ -207,7 +207,9 @@ Signals Templates ^^^^^^^^^ * ... * :tfilter:`urlize` now supports domain-only links that include characters after the top-level domain (e.g. ``djangoproject.com/`` and ``djangoproject.com/download/``). Requests and Responses ^^^^^^^^^^^^^^^^^^^^^^ Loading tests/defaultfilters/tests.py +2 −0 Original line number Diff line number Diff line Loading @@ -264,6 +264,8 @@ class DefaultFiltersTests(TestCase): '<a href="http://www.google.com" rel="nofollow">www.google.com</a>') self.assertEqual(urlize('djangoproject.org'), '<a href="http://djangoproject.org" rel="nofollow">djangoproject.org</a>') self.assertEqual(urlize('djangoproject.org/'), '<a href="http://djangoproject.org/" rel="nofollow">djangoproject.org/</a>') self.assertEqual(urlize('info@djangoproject.org'), '<a href="mailto:info@djangoproject.org">info@djangoproject.org</a>') Loading Loading
django/utils/html.py +1 −1 Original line number Diff line number Diff line Loading @@ -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) Loading
docs/ref/templates/builtins.txt +6 −0 Original line number Diff line number Diff line Loading @@ -2277,6 +2277,12 @@ It also supports domain-only links ending in one of the original top level domains (``.com``, ``.edu``, ``.gov``, ``.int``, ``.mil``, ``.net``, and ``.org``). For example, ``djangoproject.com`` gets converted. .. versionchanged:: 1.8 Support for domain-only links that include characters after the top-level domain (e.g. ``djangoproject.com/`` and ``djangoproject.com/download/``) was added. Links can have trailing punctuation (periods, commas, close-parens) and leading punctuation (opening parens), and ``urlize`` will still do the right thing. Loading
docs/releases/1.8.txt +3 −1 Original line number Diff line number Diff line Loading @@ -207,7 +207,9 @@ Signals Templates ^^^^^^^^^ * ... * :tfilter:`urlize` now supports domain-only links that include characters after the top-level domain (e.g. ``djangoproject.com/`` and ``djangoproject.com/download/``). Requests and Responses ^^^^^^^^^^^^^^^^^^^^^^ Loading
tests/defaultfilters/tests.py +2 −0 Original line number Diff line number Diff line Loading @@ -264,6 +264,8 @@ class DefaultFiltersTests(TestCase): '<a href="http://www.google.com" rel="nofollow">www.google.com</a>') self.assertEqual(urlize('djangoproject.org'), '<a href="http://djangoproject.org" rel="nofollow">djangoproject.org</a>') self.assertEqual(urlize('djangoproject.org/'), '<a href="http://djangoproject.org/" rel="nofollow">djangoproject.org/</a>') self.assertEqual(urlize('info@djangoproject.org'), '<a href="mailto:info@djangoproject.org">info@djangoproject.org</a>') Loading