diff options
| author | Claude Paroz <claude@2xlibre.net> | 2018-08-21 15:28:51 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2018-08-21 17:46:45 +0200 |
| commit | 201017df308266c7d5ed20181e6d0ffa5832e3e9 (patch) | |
| tree | b0ef49951614962cdd7409158ffd06b7f3b9bb55 /docs | |
| parent | 939dcff24f8e97d114595b102fb12348da482135 (diff) | |
Fixed #29654 -- Made text truncation an ellipsis character instead of three dots.
Thanks Sudhanshu Mishra for the initial patch and Tim Graham for the review.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 16 | ||||
| -rw-r--r-- | docs/releases/2.2.txt | 6 |
2 files changed, 14 insertions, 8 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 0d2ba1b08a..e5507e3714 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -2265,15 +2265,15 @@ If ``value`` is ``"my FIRST post"``, the output will be ``"My First Post"``. ----------------- Truncates a string if it is longer than the specified number of characters. -Truncated strings will end with a translatable ellipsis sequence ("..."). +Truncated strings will end with a translatable ellipsis character ("…"). **Argument:** Number of characters to truncate to For example:: - {{ value|truncatechars:9 }} + {{ value|truncatechars:7 }} -If ``value`` is ``"Joel is a slug"``, the output will be ``"Joel i..."``. +If ``value`` is ``"Joel is a slug"``, the output will be ``"Joel i…"``. .. templatefilter:: truncatechars_html @@ -2286,10 +2286,10 @@ are closed immediately after the truncation. For example:: - {{ value|truncatechars_html:9 }} + {{ value|truncatechars_html:7 }} If ``value`` is ``"<p>Joel is a slug</p>"``, the output will be -``"<p>Joel i...</p>"``. +``"<p>Joel i…</p>"``. Newlines in the HTML content will be preserved. @@ -2306,7 +2306,7 @@ For example:: {{ value|truncatewords:2 }} -If ``value`` is ``"Joel is a slug"``, the output will be ``"Joel is ..."``. +If ``value`` is ``"Joel is a slug"``, the output will be ``"Joel is …"``. Newlines within the string will be removed. @@ -2327,7 +2327,7 @@ For example:: {{ value|truncatewords_html:2 }} If ``value`` is ``"<p>Joel is a slug</p>"``, the output will be -``"<p>Joel is ...</p>"``. +``"<p>Joel is …</p>"``. Newlines in the HTML content will be preserved. @@ -2454,7 +2454,7 @@ For example:: If ``value`` is ``"Check out www.djangoproject.com"``, the output would be ``'Check out <a href="http://www.djangoproject.com" -rel="nofollow">www.djangopr...</a>'``. +rel="nofollow">www.djangoproj…</a>'``. As with urlize_, this filter should only be applied to plain text. diff --git a/docs/releases/2.2.txt b/docs/releases/2.2.txt index 307a2b6a06..4ca3bb9662 100644 --- a/docs/releases/2.2.txt +++ b/docs/releases/2.2.txt @@ -273,6 +273,12 @@ Miscellaneous * The return value of :func:`django.utils.text.slugify` is no longer marked as HTML safe. +* The default truncation character used by the :tfilter:`urlizetrunc`, + :tfilter:`truncatechars`, :tfilter:`truncatechars_html`, + :tfilter:`truncatewords`, and :tfilter:`truncatewords_html` template filters + is now the real ellipsis character (``…``) instead of 3 dots. You may have to + adapt some test output comparisons. + .. _deprecated-features-2.2: Features deprecated in 2.2 |
