-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Some readers cannot click on links containing backslashes (\) #267
Conversation
@aerkalov hello |
What would be the code example you are using? I am curious what kind of names are you giving to the chapters? I am asking because I don't think it is so much the issue of the library but rather of how you use it. Unicode characters, space and all other kind of characters should not be used for the file names inside of EPUB, just because some readers do not support it. I would say without really knowing how are you creating the EPUB. |
@aerkalov Hi author, sorry for forgetting to provide a code sample
from ebooklib import epub
if __name__ == '__main__':
epubook = epub.EpubBook()
for i in range(1, 10):
i = f'{i}' * i
item = epub.EpubHtml(
title=f'{i}', file_name=f'Text/{i}.xhtml',
content=f'<h1>{i}</h1><p>{i}</p>'.encode('utf8')
)
epubook.add_item(item)
epubook.spine.append(item)
epubook.toc.append(epub.Link(item.file_name, item.title, item.file_name))
nav = epub.EpubNav(file_name='nav.xhtml')
epubook.add_item(nav)
epubook.spine.insert(0, nav)
epubook.toc.insert(0, epub.Link(nav.file_name, 'nav_title', 'content'))
epubook.add_item(epub.EpubNcx())
epub.write_epub('1.epub', epubook) The resulting epub file |
I also had this problem because on Windows,
|
Also fixes #284 ? |
Presumably this was ran on windows to generate the test book? |
Thanks for this and I am not sure how I managed to miss the original post. Closing this and deploying the change which uses posixpath module rather than replace string. |
Reader
https://www.wps.cn/
or
https://www.wps.com/
Before repair
After repair