summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-10-28 03:45:51 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-10-28 03:45:51 +0000
commitb5a6ff5bdd70b5d35db473b3519866537fec0088 (patch)
treee43b91ac854254c0fb52436473e86935ad9f22f3
parentc6f375fd1124562cde131c9785e7d7f6771ef7f2 (diff)
downloaddjango-b5a6ff5bdd70b5d35db473b3519866537fec0088.tar.gz
Fixed #488 -- removetags template filter now removes tags without a space before the final slash
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1018 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/template/defaultfilters.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/template/defaultfilters.py b/django/core/template/defaultfilters.py
index 37e79ece3f..2604caf7f9 100644
--- a/django/core/template/defaultfilters.py
+++ b/django/core/template/defaultfilters.py
@@ -175,7 +175,7 @@ def removetags(value, tags):
"Removes a space separated list of [X]HTML tags from the output"
tags = [re.escape(tag) for tag in tags.split()]
tags_re = '(%s)' % '|'.join(tags)
- starttag_re = re.compile('<%s(>|(\s+[^>]*>))' % tags_re)
+ starttag_re = re.compile(r'<%s(/?>|(\s+[^>]*>))' % tags_re)
endtag_re = re.compile('</%s>' % tags_re)
value = starttag_re.sub('', value)
value = endtag_re.sub('', value)