From 170c7f91a63d3d3cb127bc9e86a93b9f15116e4b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 6 Nov 2014 12:44:30 +0530 Subject: [PATCH] ... --- src/calibre/gui2/viewer/footnote.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/gui2/viewer/footnote.py b/src/calibre/gui2/viewer/footnote.py index abe1c7737f..d5aaf3d832 100644 --- a/src/calibre/gui2/viewer/footnote.py +++ b/src/calibre/gui2/viewer/footnote.py @@ -129,6 +129,10 @@ class Footnotes(object): dest_path = self.spine_path(qurl.toLocalFile()) if dest_path is not None: if dest_path == current_path: + # We deliberately ignore linked to anchors if the destination is + # the same as the source, because many books have section ToCs + # that are linked back from their destinations, for example, + # the calibre User Manual linked_to_anchors = {} else: linked_to_anchors = {anchor:0 for path, anchor in dest_path.verified_links if path == current_path}