HTMLCleaner middleware only removes comments with an space after the two colons

This commit is contained in:
Felipe Martín 2013-05-27 16:48:29 +02:00
parent 2b588786fe
commit 9e87367acb
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ class HTMLCleanerMiddleware(object):
# Remove spaces
content = strip_spaces_between_tags(content)
# Remove HTML comments
exp = re.compile('\<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>')
exp = re.compile('\<![ \r\n\t]*(-- ([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>')
content = exp.sub('', content)
response.content = content
return response