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,7 +468,10 @@ def from_links(container):
|
||||
href = a.get('href')
|
||||
if not href or not href.strip():
|
||||
continue
|
||||
dest = container.href_to_name(href, base=name)
|
||||
if href.startswith('#'):
|
||||
dest = name
|
||||
else:
|
||||
dest = container.href_to_name(href, base=name)
|
||||
frag = href.rpartition('#')[-1] or None
|
||||
if (dest, frag) in seen_dests:
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user