Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit b5a6ff5bdd70b5d35db473b3519866537fec0088 1 parent c6f375f
Adrian Holovaty authored October 28, 2005

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  django/core/template/defaultfilters.py
2  django/core/template/defaultfilters.py
@@ -175,7 +175,7 @@ def removetags(value, tags):
175 175
     "Removes a space separated list of [X]HTML tags from the output"
176 176
     tags = [re.escape(tag) for tag in tags.split()]
177 177
     tags_re = '(%s)' % '|'.join(tags)
178  
-    starttag_re = re.compile('<%s(>|(\s+[^>]*>))' % tags_re)
  178
+    starttag_re = re.compile(r'<%s(/?>|(\s+[^>]*>))' % tags_re)
179 179
     endtag_re = re.compile('</%s>' % tags_re)
180 180
     value = starttag_re.sub('', value)
181 181
     value = endtag_re.sub('', value)

0 notes on commit b5a6ff5

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