mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2904 (created epub from odt file, tested in epubcheck, errors on images)
This commit is contained in:
parent
74875fff97
commit
7a3db36c9a
@ -64,4 +64,15 @@ class ODTInput(InputFormatPlugin):
|
|||||||
accelerators):
|
accelerators):
|
||||||
return Extract()(stream, '.')
|
return Extract()(stream, '.')
|
||||||
|
|
||||||
|
def postprocess_book(self, oeb, opts, log):
|
||||||
|
# Fix <p><div> constructs as the asinine epubchecker complains
|
||||||
|
# about them
|
||||||
|
from calibre.ebooks.oeb.base import XPath, XHTML
|
||||||
|
path = XPath('//h:p/h:div')
|
||||||
|
for item in oeb.spine:
|
||||||
|
root = item.data
|
||||||
|
if not hasattr(root, 'xpath'): continue
|
||||||
|
for div in path(root):
|
||||||
|
div.getparent().tag = XHTML('div')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user