diff --git a/src/calibre/ebooks/conversion/plugins/mobi_output.py b/src/calibre/ebooks/conversion/plugins/mobi_output.py index ab00346be9..b5dc6f17d5 100644 --- a/src/calibre/ebooks/conversion/plugins/mobi_output.py +++ b/src/calibre/ebooks/conversion/plugins/mobi_output.py @@ -311,8 +311,7 @@ class AZW3Output(OutputFormatPlugin): if not passthrough: remove_html_cover(self.oeb, self.log) - # Split on pagebreaks so that the resulting KF8 works better with - # calibre's viewer, which does not support CSS page breaks + # Split on pagebreaks so that the resulting KF8 is faster to load from calibre.ebooks.oeb.transforms.split import Split Split()(self.oeb, self.opts) diff --git a/src/calibre/ebooks/mobi/writer8/toc.py b/src/calibre/ebooks/mobi/writer8/toc.py index 74b5b9acab..7bae35ae98 100644 --- a/src/calibre/ebooks/mobi/writer8/toc.py +++ b/src/calibre/ebooks/mobi/writer8/toc.py @@ -47,7 +47,7 @@ class TOCAdder(object): if 'toc' in oeb.guide: # Remove spurious toc entry from guide if it is not in spine or it # does not have any hyperlinks - href = urlnormalize(oeb.guide['toc'].href) + href = urlnormalize(oeb.guide['toc'].href.partition('#')[0]) if href in oeb.manifest.hrefs: item = oeb.manifest.hrefs[href] if (hasattr(item.data, 'xpath') and