From ac4faa6dc33407c93566884e53fa5d8ef44c0a2a Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Wed, 13 Feb 2013 18:24:49 +0100 Subject: Fixed #19693 -- Made truncatewords_html handle self-closing tags Thanks sneawo for the report and Jonathan Loy for the patch. --- django/utils/text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/utils') diff --git a/django/utils/text.py b/django/utils/text.py index 6664b18249..02c3f10678 100644 --- a/django/utils/text.py +++ b/django/utils/text.py @@ -24,7 +24,7 @@ capfirst = allow_lazy(capfirst, six.text_type) # Set up regular expressions re_words = re.compile(r'&.*?;|<.*?>|(\w[\w-]*)', re.U|re.S) -re_tag = re.compile(r'<(/)?([^ ]+?)(?: (/)| .*?)?>', re.S) +re_tag = re.compile(r'<(/)?([^ ]+?)(?:(\s*/)| .*?)?>', re.S) def wrap(text, width): -- cgit v1.3