Mercurial > libervia-backend
diff src/plugins/plugin_misc_text_syntaxes.py @ 852:4cc55e05266d
plugin text syntaxes: fixed cleaners encoding
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 20 Feb 2014 13:28:10 +0100 |
parents | 831f208b4ea3 |
children | 75f3b3b430ff |
line wrap: on
line diff
--- a/src/plugins/plugin_misc_text_syntaxes.py Thu Feb 20 13:28:09 2014 +0100 +++ b/src/plugins/plugin_misc_text_syntaxes.py Thu Feb 20 13:28:10 2014 +0100 @@ -182,7 +182,7 @@ 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 @@ """ 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")