Commit 95046010 authored by Nicolas Delaby's avatar Nicolas Delaby

Use html output and not xhtml, as given mimetype for conversion server is text/html.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45683 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7c679f8e
...@@ -34,12 +34,9 @@ class HTMLToOdt: ...@@ -34,12 +34,9 @@ class HTMLToOdt:
# Try to recover broken HTML documents, specially regarding encoding used # Try to recover broken HTML documents, specially regarding encoding used
html_node = etree.XML(orig, parser=html_parser) html_node = etree.XML(orig, parser=html_parser)
includeMetaContentType(html_node) includeMetaContentType(html_node)
orig = html.tostring(html_node, encoding='utf-8', method='xml', orig = html.tostring(html_node, encoding='utf-8',
include_meta_content_type=True) include_meta_content_type=True)
# workaround a Bug in LibreOffice HTML import filter.
# https://bugs.freedesktop.org/show_bug.cgi?id=36080
orig = orig.replace('<title/>', '<title></title>')
doc = OOOdCommandTransform(context, filename, orig, self.inputs[0]) doc = OOOdCommandTransform(context, filename, orig, self.inputs[0])
odt = doc.convertTo('odt') odt = doc.convertTo('odt')
if cache is not None: if cache is not None:
......
...@@ -212,10 +212,9 @@ class OOOdCommandTransform(commandtransform): ...@@ -212,10 +212,9 @@ class OOOdCommandTransform(commandtransform):
parent_node.remove(css_link_tag) parent_node.remove(css_link_tag)
includeMetaContentType(xml_doc) includeMetaContentType(xml_doc)
xml_output = html.tostring(xml_doc, encoding='utf-8', method='xml', xml_output = html.tostring(xml_doc, encoding='utf-8',
include_meta_content_type=True) include_meta_content_type=True)
xml_output = xml_output.replace('<title/>', '<title></title>')
return xml_output return xml_output
def convertTo(self, format): def convertTo(self, format):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment