Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed #21101 -- Updated urlize documentation to mention email addresses #1629

Closed
wants to merge 1 commit into from

2 participants

@goetzb

Expanded the documentation for urlize template filters.
Before the edit it only mentioned web links, now the documentation also covers email addresses.

@goetzb goetzb Fixed #21101 -- Updated urlize documentation to mention email addresses
Expanded the documentation for urlize template filters. 
Before the edit it only mentioned web links, now the documentation also covers email addresses.
ac1b67d
@timgraham
Owner

Great thanks. I edited the example to make the address a bit shorter since the line was really long and didn't wrap well otherwise. merged in 39b49fd.

@timgraham timgraham closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 13, 2013
  1. @goetzb

    Fixed #21101 -- Updated urlize documentation to mention email addresses

    goetzb authored
    Expanded the documentation for urlize template filters. 
    Before the edit it only mentioned web links, now the documentation also covers email addresses.
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 2 deletions.
  1. +7 −2 docs/ref/templates/builtins.txt
View
9 docs/ref/templates/builtins.txt
@@ -2226,7 +2226,7 @@ If ``value`` is ``"http://www.example.org/"``, the output will be
urlize
^^^^^^
-Converts URLs in text into clickable links.
+Converts URLs and email addresses in text into clickable links.
This template tag works on links prefixed with ``http://``, ``https://``, or
``www.``. For example, ``http://goo.gl/aia1t`` will get converted but
@@ -2242,6 +2242,8 @@ punctuation (opening parens), and ``urlize`` will still do the right thing.
Links generated by ``urlize`` have a ``rel="nofollow"`` attribute added
to them.
+Besides web links, ``urlize`` also converts email addresses into ``mailto:`` links.
+
For example::
{{ value|urlize }}
@@ -2250,6 +2252,9 @@ If ``value`` is ``"Check out www.djangoproject.com"``, the output will be
``"Check out <a href="http://www.djangoproject.com"
rel="nofollow">www.djangoproject.com</a>"``.
+If ``value`` is ``"Please send your questions to django-users@googlegroups.com"``, the output will be
+``"Please send your questions to <a href="mailto:django-users@googlegroups.com">django-users@googlegroups.com</a>"``.
+
The ``urlize`` filter also takes an optional parameter ``autoescape``. If
``autoescape`` is ``True``, the link text and URLs will be escaped using
Django's built-in :tfilter:`escape` filter. The default value for
@@ -2265,7 +2270,7 @@ Django's built-in :tfilter:`escape` filter. The default value for
urlizetrunc
^^^^^^^^^^^
-Converts URLs into clickable links just like urlize_, but truncates URLs
+Converts URLs and email addresses into clickable links just like urlize_, but truncates URLs
longer than the given character limit.
**Argument:** Number of characters that link text should be truncated to,
Something went wrong with that request. Please try again.