From 097fb98f81b9d9dd3faac45f5b93d620098041bc Mon Sep 17 00:00:00 2001 From: Goetz Date: Fri, 13 Sep 2013 16:45:42 +0100 Subject: [PATCH] [1.6.x] Fixed #21101 -- Updated urlize documentation to mention email addresses Backport of 39b49fd339 from master --- docs/ref/templates/builtins.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 929c66a8cc..3c64efb508 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -2220,7 +2220,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 @@ -2244,6 +2244,11 @@ If ``value`` is ``"Check out www.djangoproject.com"``, the output will be ``"Check out www.djangoproject.com"``. +In addition to web links, ``urlize`` also converts email addresses into +``mailto:`` links. If ``value`` is +``"Send questions to foo@example.com"``, the output will be +``"Send questions to foo@example"``. + 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 @@ -2259,7 +2264,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,