id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux
488,[patch] removetags filter doesn't remove tags without a seperate ending tag,ilikeprivacy@…,Adrian Holovaty,"the removetags filter incorrectly doesn't remove
(possibly 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
}}}",defect,closed,Template system,,normal,fixed,,,Unreviewed,1,0,0,0,0,0