From 7a3db36c9a5ad89a92c3f3d5ecce5d9148f6171e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 27 Jul 2009 11:58:49 -0600 Subject: [PATCH] Fix #2904 (created epub from odt file, tested in epubcheck, errors on images) --- src/calibre/ebooks/odt/input.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/calibre/ebooks/odt/input.py b/src/calibre/ebooks/odt/input.py index 7d6498ab81..28e7044201 100644 --- a/src/calibre/ebooks/odt/input.py +++ b/src/calibre/ebooks/odt/input.py @@ -64,4 +64,15 @@ class ODTInput(InputFormatPlugin): accelerators): return Extract()(stream, '.') + def postprocess_book(self, oeb, opts, log): + # Fix

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') +