This commit is contained in:
Kovid Goyal 2025-01-10 13:34:25 +05:30
parent 9a88afb370
commit 49b8fadbc2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -162,9 +162,8 @@ def replace_calibre_links_to_books(html):
changed = False changed = False
dom.body.querySelectorAll('a[href]').forEach(def (link): dom.body.querySelectorAll('a[href]').forEach(def (link):
nonlocal changed nonlocal changed
if not link.href: if not link.href or not link.href.startswith('calibre://'):
return return
if link.href.startswith('calibre://'):
url = v'new URL(link.href, window.location.origin)' url = v'new URL(link.href, window.location.origin)'
if url.hostname is not 'show-book' and url.hostname is not 'view-book': if url.hostname is not 'show-book' and url.hostname is not 'view-book':
return return