mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Edit Book: Fix an error caused by a landmark entry in EPUB 3 files that has an <a> tag without an href attribute.
This commit is contained in:
parent
499578beaa
commit
b1ee6be746
@ -310,6 +310,7 @@ def get_nav_landmarks(container):
|
|||||||
for li in elem.iterdescendants(XHTML('li')):
|
for li in elem.iterdescendants(XHTML('li')):
|
||||||
for a in li.iterdescendants(XHTML('a')):
|
for a in li.iterdescendants(XHTML('a')):
|
||||||
href, rtype = a.get('href'), a.get(et)
|
href, rtype = a.get('href'), a.get(et)
|
||||||
|
if href:
|
||||||
title = etree.tostring(a, method='text', encoding=unicode, with_tail=False).strip()
|
title = etree.tostring(a, method='text', encoding=unicode, with_tail=False).strip()
|
||||||
href, frag = href.partition('#')[::2]
|
href, frag = href.partition('#')[::2]
|
||||||
name = container.href_to_name(href, nav)
|
name = container.href_to_name(href, nav)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user