From b5a6ff5bdd70b5d35db473b3519866537fec0088 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 28 Oct 2005 03:45:51 +0000 Subject: [PATCH] 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 --- django/core/template/defaultfilters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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('' % tags_re) value = starttag_re.sub('', value) value = endtag_re.sub('', value)