diff --git a/src/calibre/gui2/tweak_book/__init__.py b/src/calibre/gui2/tweak_book/__init__.py index 1e41f35c78..069c70cea5 100644 --- a/src/calibre/gui2/tweak_book/__init__.py +++ b/src/calibre/gui2/tweak_book/__init__.py @@ -114,6 +114,8 @@ def verify_link(url, name=None): target = _current_container.href_to_name(url, name) if _current_container.has_name(target): return True + if url.startswith('#'): + return True if url.partition(':')[0] in {'http', 'https', 'mailto'}: return True return False diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index b29dfaaf8f..68daa2e371 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -798,7 +798,10 @@ class Boss(QObject): def editor_link_clicked(self, url): ed = self.gui.central.current_editor name = editor_name(ed) - target = current_container().href_to_name(url, name) + if url.startswith('#'): + target = name + else: + target = current_container().href_to_name(url, name) frag = url.partition('#')[-1] if current_container().has_name(target): self.link_clicked(target, frag)