summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-02-13 18:24:49 +0100
committerClaude Paroz <claude@2xlibre.net>2013-02-13 18:24:49 +0100
commitac4faa6dc33407c93566884e53fa5d8ef44c0a2a (patch)
tree2e2dcd120ca8cff7782fd2a29348cff2f63500c0 /django
parente94f405d9499d310ef58b7409a98759a5f5512b0 (diff)
Fixed #19693 -- Made truncatewords_html handle self-closing tags
Thanks sneawo for the report and Jonathan Loy for the patch.
Diffstat (limited to 'django')
-rw-r--r--django/utils/text.py2
1 files changed, 1 insertions, 1 deletions
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):