mirror of
https://github.com/django/django.git
synced 2025-09-22 02:02:46 +00:00
Fixed #19693 -- Made truncatewords_html handle self-closing tags
Thanks sneawo for the report and Jonathan Loy for the patch.
This commit is contained in:
parent
e94f405d94
commit
ac4faa6dc3
2 changed files with 20 additions and 9 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue