mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1980492 [Reports' links error](https://bugs.launchpad.net/calibre/+bug/1980492)
This commit is contained in:
parent
65c55a6d44
commit
50c95494b5
@ -165,13 +165,13 @@ def links_data(container, *args):
|
|||||||
for a in link_pat(root):
|
for a in link_pat(root):
|
||||||
href = a.get('href')
|
href = a.get('href')
|
||||||
text = description_for_anchor(a)
|
text = description_for_anchor(a)
|
||||||
|
location = LinkLocation(name, a.sourceline, href)
|
||||||
if href:
|
if href:
|
||||||
base, frag = href.partition('#')[0::2]
|
base, frag = href.partition('#')[0::2]
|
||||||
if frag and not base:
|
if frag and not base:
|
||||||
dest = name
|
dest = name
|
||||||
else:
|
else:
|
||||||
dest = safe_href_to_name(container, href, name)
|
dest = safe_href_to_name(container, href, name)
|
||||||
location = LinkLocation(name, a.sourceline, href)
|
|
||||||
links.append((base, frag, dest, location, text))
|
links.append((base, frag, dest, location, text))
|
||||||
else:
|
else:
|
||||||
links.append(('', '', None, location, text))
|
links.append(('', '', None, location, text))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user