mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Viewer: Fix a regression in the previous release that broke reading of books with mathematics and also <a> tags without href attributes. Fixes #1886192 [EPUB crashes. Cannot read property 'startswith'.](https://bugs.launchpad.net/calibre/+bug/1886192)
This commit is contained in:
parent
304f682808
commit
9d7dc2e2fa
@ -19,7 +19,7 @@ def get_url(mathjax_files, name):
|
||||
def postprocess(link_uid):
|
||||
for a in document.getElementsByTagName('a'):
|
||||
href = a.getAttribute('href')
|
||||
if href.startswith('#'):
|
||||
if href and href.startswith('#'):
|
||||
a.setAttribute('href', 'javascript: void(0)')
|
||||
a.setAttribute('data-' + link_uid, JSON.stringify({'frag':href[1:]}))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user