[patch] removetags filter doesn't remove tags without a seperate ending tag
the removetags filter incorrectly doesn't remove <br/> (possibly <img/> as well however I haven't tested).
I've included (sorry I'm unsure of the correct way to create and upload a patch, svn diff includes all my mods to other files) my modified filter which works, someone better with regular expressions can probably tweak the existing ones.
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)
endtag_re = re.compile('</%s>' % tags_re)
singletag_re = re.compile('<%s*/>' % tags_re)
value = starttag_re.sub('', value)
value = endtag_re.sub('', value)
value = singletag_re.sub('', value)
return value
patch