Skip to content
Browse files

Fixed #488 -- removetags template filter now removes tags without a s…

…pace before the final slash

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1018 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent c6f375f commit b5a6ff5bdd70b5d35db473b3519866537fec0088 @adrianholovaty adrianholovaty committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/core/template/defaultfilters.py
View
2 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)

0 comments on commit b5a6ff5

Please sign in to comment.
Something went wrong with that request. Please try again.