mirror of
https://github.com/django/django.git
synced 2025-10-30 17:16:10 +00:00
Fixed #11021 -- Clarified newline stripping behavior in the truncatewords and truncatewords_html filters. Thanks to Ben Spaulding for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13555 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -256,6 +256,8 @@ def truncatewords(value, arg):
|
||||
Truncates a string after a certain number of words.
|
||||
|
||||
Argument: Number of words to truncate after.
|
||||
|
||||
Newlines within the string are removed.
|
||||
"""
|
||||
from django.utils.text import truncate_words
|
||||
try:
|
||||
@@ -271,6 +273,8 @@ def truncatewords_html(value, arg):
|
||||
Truncates HTML after a certain number of words.
|
||||
|
||||
Argument: Number of words to truncate after.
|
||||
|
||||
Newlines in the HTML are preserved.
|
||||
"""
|
||||
from django.utils.text import truncate_html_words
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user