aerkalov / ebooklib

Python E-book library for handling books in EPUB2/EPUB3 format -
https://ebooklib.readthedocs.io/
GNU Affero General Public License v3.0
1.49k stars 234 forks source link

Issue about section link in nav.xhtml #275

Open ANXIETIER opened 1 year ago

ANXIETIER commented 1 year ago

At line 1164 in file epub.py, if link inculdes separator as '/', code* os.path.relpath(item.href, nav_dir_name) of a = etree.SubElement(li, 'a', {'href': os.path.relpath(item.href, nav_dir_name)}) returns link string with separator '\' which not supported in sigil.

I tried that the code os.path.relpath(item.href, nav_dir_name).replace('\\', '/') can solve my problem, I dont know if other lines with code* can make same bug.