mirror of
https://github.com/django/django.git
synced 2025-11-18 11:00:24 +00:00
make strip_spaces_between_tags lazy
This commit is contained in:
parent
ea3a71c2d0
commit
9da7cd51a2
1 changed files with 3 additions and 1 deletions
|
|
@ -228,11 +228,13 @@ def strip_tags(value):
|
|||
strip_tags_depth += 1
|
||||
return value
|
||||
|
||||
_strip_spaces_pattern = _lazy_re_compile(r">\s+<")
|
||||
|
||||
|
||||
@keep_lazy_text
|
||||
def strip_spaces_between_tags(value):
|
||||
"""Return the given HTML with spaces between tags removed."""
|
||||
return re.sub(r">\s+<", "><", str(value))
|
||||
return _strip_spaces_pattern.sub("><", str(value))
|
||||
|
||||
|
||||
def smart_urlquote(url):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue