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

Failure to render a file #7

Open
vlichevsky opened this issue Nov 17, 2021 · 10 comments
Open

Failure to render a file #7

vlichevsky opened this issue Nov 17, 2021 · 10 comments
Labels
bug Something isn't working

Comments

@vlichevsky
Copy link

Some files cannot be rendered by fb2-reader. I get the following error:

Error during redisplay: (eval (list (propertize " " 'display '((space :align-to 0))) (fb2-reader-header-line-text))) signaled (wrong-type-argument number-or-marker-p nil) [4 times]
error in process sentinel: Invalid read syntax: "#" [2 times]
Error during redisplay: (eval (list (propertize " " 'display '((space :align-to 0))) (fb2-reader-header-line-text))) signaled (wrong-type-argument number-or-marker-p nil)

Sample file

@jumper047
Copy link
Owner

Interesting! Seems like something wrong with the book - libxml-parse-xml-region returns nil. But for some reason libxml-parse-html-region works fine. It need some research.

@jumper047 jumper047 added the bug Something isn't working label Nov 17, 2021
@jumper047
Copy link
Owner

I found the string which causes an issue - "

��ю�kжэ

". Not sure what this supposed to mean. Also links in the book are not proper fb2 links, which is strange too. I suppose this is because of software used to produce this fb2. Do you have other books which are not rendered by fb2-reader?

@vlichevsky
Copy link
Author

Yeah, looks like this file contains a mix of cp-1251 encoding with some other, or even just random garbage. I haven't noticed this before, because the fb2 reader I currently use (FBReader) somehow manages to display it. I am not sure, whether it is worth it to try and render such files. A more clear error message would be nice though.
If I find books which are not rendered by fb2-reader and not of trash quality like this one I'll report in this issue.

@jumper047
Copy link
Owner

I also noticed another thing - there is no bodies inside that book (as far as I know they should be in correct fb2 document). So I can get xml tree from the book, but my parser can't parse it correctly because of xml structure. Document metadata mentioned software name used to produce it - LibRusEc kit, maybe it produces special fb2 "flavor". So support for such type of files seems doable, but I need more info / book examples. Help is appreciated!:). For now I'll add message in case reader couldn't parse book.

@jumper047
Copy link
Owner

Update: adding messages is boring, so I fixed rendering for this type of books - commits already pushed so you'll receive update soon.

@vlichevsky
Copy link
Author

Another problematic file: https://transfer.sh/CIvCgs/eko_imya-rozy.8ndkkg.460991.fb2.gz

Fails with the same message as in the first post.

@jumper047
Copy link
Owner

Thx, seems like my previous suggestion about how parse-html works was incorrect. Hope I'll fix it soon.

@jumper047
Copy link
Owner

Should be fixed now - also added messages when fb2 parsing failed.

@vlichevsky
Copy link
Author

Thanks! Broken files can be displayed now. Although Error during redisplay: ... is still shown for some files (but they are rendered OK).

@jumper047
Copy link
Owner

Nice! Though I'll leave this issue open until I figure out redisplay error.

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

2 participants