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

Render page as HTML if it's is not valid XHTML #699

Closed
Rudo2204 opened this issue Mar 29, 2021 · 4 comments
Closed

Render page as HTML if it's is not valid XHTML #699

Rudo2204 opened this issue Mar 29, 2021 · 4 comments
Labels
enhancement New feature or request epub.js Related to Epub.js
Milestone

Comments

@Rudo2204
Copy link

Question:
When Foliate encounters mismatching tag, it shows a big red box with these info.

This page contains the following errors:
error on line 20 at column 40: Opening and ending tag mismatch: span line 0 and p
Below is a rendering of the page up to the first error.

Is there any way I can force Foliate to ignore these non-fatal errors? (aka no red boxes)
Version:

  • Foliate version: 2.6.2
  • OS/Distribution and version: MX 19.3
  • Desktop environment: xfce4
  • Installation method: dpkg
@Rudo2204 Rudo2204 added the question Further information is requested label Mar 29, 2021
@Rudo2204
Copy link
Author

I take back what I said about "non-fatal". I forgot that epub uses XHTML, so you have to close tags...

@Rudo2204
Copy link
Author

I found a workaround which is to convert the bad formatted epub to a properly formatted one using calibre, then Foliate can read it normally. I'm not sure if this issue is still relevant but it would be nice if Foliate can render the bad one normally like calibre without having to convert first.

@johnfactotum
Copy link
Owner

I think maybe it can try detecting the error and try parsing as HTML instead. It would require patching Epub.js, though.

@johnfactotum johnfactotum added enhancement New feature or request epub.js Related to Epub.js and removed question Further information is requested labels Jun 30, 2021
This was referenced Sep 30, 2022
@johnfactotum johnfactotum changed the title Ignore mismatching tag Render page as HTML if it's is not valid XHTML Sep 30, 2022
@johnfactotum
Copy link
Owner

Fixed in the gtk4 branch.

@johnfactotum johnfactotum added this to the 3.0 milestone Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request epub.js Related to Epub.js
Projects
None yet
Development

No branches or pull requests

2 participants