diff --git a/src/calibre/web/feeds/__init__.py b/src/calibre/web/feeds/__init__.py index 88fc1dc822..313851ef33 100644 --- a/src/calibre/web/feeds/__init__.py +++ b/src/calibre/web/feeds/__init__.py @@ -34,6 +34,7 @@ class Article(object): self.url = url self.author = author self.toc_thumbnail = None + self.internal_toc_entries = () if author and not isinstance(author, unicode_type): author = author.decode('utf-8', 'replace') if summary and not isinstance(summary, unicode_type): diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index c57c68c536..55681613e1 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -1522,10 +1522,14 @@ class BasicNewsRecipe(Recipe): arelpath = '%sindex.html'%adir for curl in self.canonicalize_internal_url(a.orig_url, is_link=False): aumap[curl].add(arelpath) - parent.add_item(arelpath, None, + article_toc_entry = parent.add_item(arelpath, None, a.title if a.title else _('Untitled article'), play_order=po, author=auth, description=desc, toc_thumbnail=tt) + for entry in a.internal_toc_entries: + self.play_order_counter += 1 + po += 1 + article_toc_entry.add_item(arelpath, entry['anchor'], entry['title'], play_order=po) last = os.path.join(self.output_dir, ('%sindex.html'%adir).replace('/', os.sep)) for sp in a.sub_pages: prefix = os.path.commonprefix([opf_path, sp])