plugin text syntaxes: fixed cleaners encoding

This commit is contained in:
Goffi 2014-02-20 13:28:10 +01:00
commit fd22cf011d

View file

@ -182,7 +182,7 @@ class TextSyntaxes(object):
xhtml_elt = cleaner.clean_html(xhtml_elt)
for elt in xhtml_elt.xpath("//*[@style]"):
elt.set("style", clean_style(elt.get('style')))
return html.tostring(xhtml_elt, method='xml')
return html.tostring(xhtml_elt, encoding=unicode, method='xml')
return deferToThread(blocking_cleaning, xhtml)
@ -256,4 +256,4 @@ class TextSyntaxes(object):
"""
cleaner = clean.Cleaner(kill_tags=['style'])
cleaned = cleaner.clean_html(html.fromstring(xhtml))
return html.tostring(cleaned, method="text")
return html.tostring(cleaned, encoding=unicode, method="text")