When getting verified links handle links relative to the current file

This commit is contained in:
Kovid Goyal 2014-11-05 22:33:51 +05:30
parent a2f008766e
commit b70d23f3e4

View File

@ -191,9 +191,10 @@ class EbookIterator(BookmarksMixin):
p = urlparse(urlunquote(link))
except Exception:
continue
if not p.scheme and not p.netloc and p.path:
if not p.scheme and not p.netloc:
path = os.path.abspath(os.path.join(base, p.path)) if p.path else item
try:
path = spine_paths[os.path.abspath(os.path.join(base, p.path))]
path = spine_paths[path]
except Exception:
continue
if not p.fragment or p.fragment in path.anchor_map: