mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix highlighting of anchor only links
This commit is contained in:
parent
ce72dcb64b
commit
82c33f585c
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user