HTML parser fix
- the UTF-8-ifying of tags had missing brackets
This commit is contained in:
parent
40090a9a12
commit
671f321ead
|
@ -82,7 +82,7 @@ class SafeHTMLParser(HTMLParser):
|
||||||
val == ""
|
val == ""
|
||||||
self.sanitised += " " + quote_plus(attr)
|
self.sanitised += " " + quote_plus(attr)
|
||||||
if not (val is None):
|
if not (val is None):
|
||||||
self.sanitised += "=\"" + val if isinstance(val, unicode) else unicode(val, 'utf-8', 'replace') + "\""
|
self.sanitised += "=\"" + (val if isinstance(val, unicode) else unicode(val, 'utf-8', 'replace')) + "\""
|
||||||
if inspect.stack()[1][3] == "handle_startendtag":
|
if inspect.stack()[1][3] == "handle_startendtag":
|
||||||
self.sanitised += "/"
|
self.sanitised += "/"
|
||||||
self.sanitised += ">"
|
self.sanitised += ">"
|
||||||
|
|
Reference in New Issue
Block a user