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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user