mirror of
https://github.com/django/django.git
synced 2025-09-17 07:55:33 +00:00
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1967 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e260037e16
commit
0eaee6f5d4
4 changed files with 51 additions and 0 deletions
|
@ -37,6 +37,10 @@ def strip_tags(value):
|
|||
"Returns the given HTML with all tags stripped"
|
||||
return re.sub(r'<[^>]*?>', '', value)
|
||||
|
||||
def strip_spaces_between_tags(value):
|
||||
"Returns the given HTML with spaces between tags stripped"
|
||||
return re.sub(r'>\s+<', '><', value)
|
||||
|
||||
def strip_entities(value):
|
||||
"Returns the given HTML with all entities (&something;) stripped"
|
||||
return re.sub(r'&(?:\w+|#\d);', '', value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue