From 201017df308266c7d5ed20181e6d0ffa5832e3e9 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Tue, 21 Aug 2018 15:28:51 +0200 Subject: 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. --- docs/ref/templates/builtins.txt | 16 ++++++++-------- docs/releases/2.2.txt | 6 ++++++ 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'docs') 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 ``"

Joel is a slug

"``, the output will be -``"

Joel i...

"``. +``"

Joel i…

"``. 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 ``"

Joel is a slug

"``, the output will be -``"

Joel is ...

"``. +``"

Joel is …

"``. 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 www.djangopr...'``. +rel="nofollow">www.djangoproj…'``. 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 -- cgit v1.3