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 /django/utils/html.py | |
| 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 'django/utils/html.py')
| -rw-r--r-- | django/utils/html.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/html.py b/django/utils/html.py index c5035e3b23..72719cdd2d 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -245,7 +245,7 @@ def urlize(text, trim_url_limit=None, nofollow=False, autoescape=False): leading punctuation (opening parens) and it'll still do the right thing. If trim_url_limit is not None, truncate the URLs in the link text longer - than this limit to trim_url_limit-3 characters and append an ellipsis. + than this limit to trim_url_limit - 1 characters and append an ellipsis. If nofollow is True, give the links a rel="nofollow" attribute. @@ -256,7 +256,7 @@ def urlize(text, trim_url_limit=None, nofollow=False, autoescape=False): def trim_url(x, limit=trim_url_limit): if limit is None or len(x) <= limit: return x - return '%s...' % x[:max(0, limit - 3)] + return '%s…' % x[:max(0, limit - 1)] def unescape(text, trail): """ |
