summaryrefslogtreecommitdiff
path: root/django/utils/html.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-08-18 17:47:21 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-08-18 17:51:16 +0200
commitafc1bd7ab87268b33a8b44b3238f562cdaf2a72f (patch)
tree6b434993c1e4113f8a1c724f7e05a6e6e22873c0 /django/utils/html.py
parentde3ad8bb2d14ccf878121b96e6e0359dd8b1f9d5 (diff)
[py3] Made 212b9826bd Python 3-friendly
Diffstat (limited to 'django/utils/html.py')
-rw-r--r--django/utils/html.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/django/utils/html.py b/django/utils/html.py
index 13954ce195..0ee789ebb5 100644
--- a/django/utils/html.py
+++ b/django/utils/html.py
@@ -126,13 +126,13 @@ strip_tags = allow_lazy(strip_tags)
def remove_tags(html, tags):
"""Returns the given HTML with given tags removed."""
tags = [re.escape(tag) for tag in tags.split()]
- tags_re = u'(%s)' % u'|'.join(tags)
- starttag_re = re.compile(ur'<%s(/?>|(\s+[^>]*>))' % tags_re, re.U)
- endtag_re = re.compile(u'</%s>' % tags_re)
- html = starttag_re.sub(u'', html)
- html = endtag_re.sub(u'', html)
+ tags_re = '(%s)' % '|'.join(tags)
+ starttag_re = re.compile(r'<%s(/?>|(\s+[^>]*>))' % tags_re, re.U)
+ endtag_re = re.compile('</%s>' % tags_re)
+ html = starttag_re.sub('', html)
+ html = endtag_re.sub('', html)
return html
-remove_tags = allow_lazy(remove_tags, unicode)
+remove_tags = allow_lazy(remove_tags, six.text_type)
def strip_spaces_between_tags(value):
"""Returns the given HTML with spaces between tags removed."""