mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 03:53:51 +02:00
Fix #2904 (created epub from odt file, tested in epubcheck, errors on images)
This commit is contained in:
parent
74875fff97
commit
7a3db36c9a
1 changed files with 11 additions and 0 deletions
|
|
@ -64,4 +64,15 @@ def convert(self, stream, options, file_ext, log,
|
|||
accelerators):
|
||||
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…
Reference in a new issue