1
0
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:
Russell Keith-Magee
2010-08-07 14:57:24 +00:00
parent 103f7f83eb
commit 806f3b26f8
3 changed files with 17 additions and 3 deletions

View File

@@ -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: