ToC editor: Fix generating toc entries from links not working for links that start with #

This commit is contained in:
Kovid Goyal 2018-08-22 13:12:51 +05:30
parent b20be85375
commit a6ef8f7efd
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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