diff --git a/src/calibre/ebooks/mobi/writer8/toc.py b/src/calibre/ebooks/mobi/writer8/toc.py index 1d064b2068..ab8ff87819 100644 --- a/src/calibre/ebooks/mobi/writer8/toc.py +++ b/src/calibre/ebooks/mobi/writer8/toc.py @@ -44,7 +44,7 @@ def find_previous_calibre_inline_toc(oeb): class TOCAdder(object): - def __init__(self, oeb, opts, replace_previous_inline_toc=False, ignore_existing_toc=False): + def __init__(self, oeb, opts, replace_previous_inline_toc=True, ignore_existing_toc=False): self.oeb, self.opts, self.log = oeb, opts, oeb.log self.title = opts.toc_title or DEFAULT_TITLE self.at_start = opts.mobi_toc_at_start @@ -53,7 +53,7 @@ class TOCAdder(object): self.has_toc = oeb.toc and oeb.toc.count() > 1 self.tocitem = tocitem = None - if find_previous_calibre_inline_toc: + if replace_previous_inline_toc: tocitem = self.tocitem = find_previous_calibre_inline_toc(oeb) if ignore_existing_toc and 'toc' in oeb.guide: oeb.guide.remove('toc')