[FIX] compile of rst module descriptions to HTML
lxml (used by the html sanitizer) really does not like documents as unicode strings with an encoding declaration (which doesn't make sense indeed), yet docutils with output_encoding=unicode generates one (a stupid one too, says "encoding=unicode"). Disable the xml declaration altogether when compiling rST module declarations to HTML.
This commit is contained in:
parent
2859d24c5e
commit
2f3aa63617
|
@ -177,7 +177,12 @@ class module(osv.osv):
|
|||
element.set('src', "/%s/static/description/%s" % (module.name, element.get('src')))
|
||||
res[module.id] = lxml.html.tostring(html)
|
||||
else:
|
||||
overrides = dict(embed_stylesheet=False, doctitle_xform=False, output_encoding='unicode')
|
||||
overrides = {
|
||||
'embed_stylesheet': False,
|
||||
'doctitle_xform': False,
|
||||
'output_encoding': 'unicode',
|
||||
'xml_declaration': False,
|
||||
}
|
||||
output = publish_string(source=module.description, settings_overrides=overrides, writer=MyWriter())
|
||||
res[module.id] = output
|
||||
return res
|
||||
|
|
Loading…
Reference in New Issue