Skip to content
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

When a document contains a colon or a question mark in the title, Bookworm does not show the table of contents or does not jump to the desired chapter if it shows the table of contents #147

Open
DraganRatkovich opened this issue Mar 30, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@DraganRatkovich
Copy link
Collaborator

DraganRatkovich commented Mar 30, 2022

Describe the Problem

It's been a long time since I reproduced this issue, I've tried many ways to reproduce the problem with different sizes, pages, and document types, and all the time I've had different results, so I really don't know how to explain in detail the exact problem I'm having, but I'll try to describe.

I had a Georgian document in three formats, pdf, epub and docx, and they all contained a colon and a question mark in the title. Notice I mean the title in the document, not the filename of the document.

When I opened the above mentioned documents, the 64 bit version of Bookworm didn't show any table of contents even though the document contained chapters, but the 32 bit version showed the table of contents as it was in the document, but when I clicked on the chapter I needed to jump to, Bookworm only jumped to the first page of the document and the initial letter, not to a specific chapter.

I later removed from both versions the "database" and "saved data" folders that are stored in the bookworm's user configuration and the 64 bit version showed the table of contents as expected, but still didn't jump to the pressed chapter and moved to the top of the page, as in the 32-bit version.

When I removed the colon from the document name, the 64-bit version of Bookworm showed the table of contents without any problems and jumped to the desired chapter when clicked, but now the 32-bit version did not show the table of contents, but when I again removed the above folders from the 32-bit version of the user configuration, it showed and jumped to the desired chapter.

After several attempts, the .docx document type opened without problems and also jumped to the right chapter of the document in both versions, but this problem seriously affects the .epub and .pdf files.

The Debug mode log shows only

these lines

ERROR - bookworm.bookworm.bootstrap - 30/03/2022 13:17:46 - MainThread (6092): Invalid or unknown document uri: nul

Traceback (most recent call last):

File "bookworm\bootstrap.py", line 72, in _open_arg_file

File "bookworm\document\uri.py", line 117, in from_base64_encoded_string

File "base64.py", line 133, in urlsafe_b64decode

File "base64.py", line 87, in b64decode

binascii.Error: Incorrect padding

Also, I want to note that when Bookworm didn't show the table of contents, the keyboard shortcut for closing, i.e. ctrl+w, also didn't work, and I had to press alt+f, then e, to close, but that also didn't work, and I had to press twice quickly to close the whole program.

To Reproduce

  1. Open bookworm;
  2. Download all files listed below in the issue comment;
  3. Please read the issue comment carefully and patiently and try to reproduce the issue yourself.

Please note that in all types of documents, file1 is a document that does not contain a colon and a question mark and opens without problems.

Expected behavior

Bookworm should open the document and display the table of contents correctly.

The File You've Opened

Desktop (please complete the following information):

  • OS: Windows 10 64-bit;
  • Bookworm version: recent, downloaded from AppVeyor;
  • Settings changed: none

@mush42 Please take a look as this is frustrating when opening documents that have a table of contents. To open such documents, I have to change the title every time.

@DraganRatkovich DraganRatkovich changed the title When a document contains a colon or a question mark in the title, Bookworm does not show the table of contents or jump to the correct chapter if it does When a document contains a colon or a question mark in the title, Bookworm does not show the table of contents or does not jump to the desired chapter if it shows the table of contents Mar 30, 2022
@mush42
Copy link
Collaborator

mush42 commented Mar 30, 2022

@DraganRatkovich
Does this applies to English documents as well?
If so, please provide an English document.

@DraganRatkovich
Copy link
Collaborator Author

@mush42 Excuse me, I forget to test English and now did it and yes, also affected by this issue. I will give links down below. English2 is a file whose title contains a colon and a question mark, while English1 is a document without a colon and a question mark in the title.

Here are the links

@DraganRatkovich
Copy link
Collaborator Author

@mush42 Hmm, interesting things have happened now with the latest 64-bit build downloaded from AppVeyor. When I clicked the second chapter in the table of contents, Bookworm didn't jump to that chapter, but when I clicked the first chapter and then the second chapter, it jumped to that chapter. However, if I remove the colon and the question mark from the title, it jumps to the right chapter without any problem.

@DraganRatkovich
Copy link
Collaborator Author

@mush42 Do you have any news here?

@mush42
Copy link
Collaborator

mush42 commented Apr 12, 2022

Hello @DraganRatkovich
I'm a bit busy in work these days. I'm not even able to open GitHub to check open issues.
I'll work on this one an other issues as soon as I've some free time.

Best
Musharraf

@DraganRatkovich DraganRatkovich added the Improvement Improving or fixing an existing feature label Jun 14, 2022
@pauliyobo pauliyobo added bug Something isn't working and removed Improvement Improving or fixing an existing feature labels Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants