From 852007e8c7ba81e57ba81a9fde240caca7930cb6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 5 Nov 2014 22:36:25 +0530 Subject: [PATCH] Do not add anchors linked from the current file to linked_to_anchors --- src/calibre/gui2/viewer/footnote.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/viewer/footnote.py b/src/calibre/gui2/viewer/footnote.py index 63c0e02a51..abe1c7737f 100644 --- a/src/calibre/gui2/viewer/footnote.py +++ b/src/calibre/gui2/viewer/footnote.py @@ -128,7 +128,10 @@ class Footnotes(object): return # Not viewing a local file dest_path = self.spine_path(qurl.toLocalFile()) if dest_path is not None: - linked_to_anchors = {anchor:0 for path, anchor in dest_path.verified_links if path == current_path} + if dest_path == current_path: + linked_to_anchors = {} + else: + linked_to_anchors = {anchor:0 for path, anchor in dest_path.verified_links if path == current_path} self.view.document.bridge_value = linked_to_anchors if a.evaluateJavaScript('calibre_extract.is_footnote_link(this)'): if dest_path not in self.known_footnote_targets: