plugin text syntaxes: fixed cleaners encoding
This commit is contained in:
parent
cf08f0127a
commit
fd22cf011d
1 changed files with 2 additions and 2 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in a new issue