From aa4a177c0442feb96b0b7ba32d8f7ba6dc5eb30d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 12 Aug 2018 08:22:50 +0530 Subject: [PATCH] E-book viewer: Fix clicking links in the footnote popup ignoring the anchor part of the link. Fixes #1786577 [Private bug](https://bugs.launchpad.net/calibre/+bug/1786577) --- src/calibre/gui2/viewer/documentview.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/viewer/documentview.py b/src/calibre/gui2/viewer/documentview.py index 7a0c6887d1..15446950ff 100644 --- a/src/calibre/gui2/viewer/documentview.py +++ b/src/calibre/gui2/viewer/documentview.py @@ -854,7 +854,10 @@ class DocumentView(QWebView): # {{{ self.link_clicked(qurl) return path = qurl.toLocalFile() - self.link_clicked(self.as_url(path)) + link = self.as_url(path) + if qurl.hasFragment(): + link.setFragment(qurl.fragment(QUrl.FullyEncoded), QUrl.StrictMode) + self.link_clicked(link) def sizeHint(self): return self._size_hint