1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

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.
This commit is contained in:
Claude Paroz
2018-08-21 15:28:51 +02:00
parent 939dcff24f
commit 201017df30
14 changed files with 65 additions and 60 deletions

View File

@@ -280,7 +280,7 @@ def truncatewords(value, arg):
length = int(arg)
except ValueError: # Invalid literal for int().
return value # Fail silently.
return Truncator(value).words(length, truncate=' ...')
return Truncator(value).words(length, truncate=' ')
@register.filter(is_safe=True)
@@ -294,7 +294,7 @@ def truncatewords_html(value, arg):
length = int(arg)
except ValueError: # invalid literal for int()
return value # Fail silently.
return Truncator(value).words(length, html=True, truncate=' ...')
return Truncator(value).words(length, html=True, truncate=' ')
@register.filter(is_safe=False)