mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
ToC editor: Fix generating toc entries from links not working for links that start with #
This commit is contained in:
parent
b20be85375
commit
a6ef8f7efd
@ -468,6 +468,9 @@ def from_links(container):
|
|||||||
href = a.get('href')
|
href = a.get('href')
|
||||||
if not href or not href.strip():
|
if not href or not href.strip():
|
||||||
continue
|
continue
|
||||||
|
if href.startswith('#'):
|
||||||
|
dest = name
|
||||||
|
else:
|
||||||
dest = container.href_to_name(href, base=name)
|
dest = container.href_to_name(href, base=name)
|
||||||
frag = href.rpartition('#')[-1] or None
|
frag = href.rpartition('#')[-1] or None
|
||||||
if (dest, frag) in seen_dests:
|
if (dest, frag) in seen_dests:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user