Do not add anchors linked from the current file to linked_to_anchors

This commit is contained in:
Kovid Goyal 2014-11-05 22:36:25 +05:30
parent b70d23f3e4
commit 852007e8c7

View File

@ -128,6 +128,9 @@ class Footnotes(object):
return # Not viewing a local file return # Not viewing a local file
dest_path = self.spine_path(qurl.toLocalFile()) dest_path = self.spine_path(qurl.toLocalFile())
if dest_path is not None: if dest_path is not None:
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} 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 self.view.document.bridge_value = linked_to_anchors
if a.evaluateJavaScript('calibre_extract.is_footnote_link(this)'): if a.evaluateJavaScript('calibre_extract.is_footnote_link(this)'):