Giter Club home page Giter Club logo

Comments (13)

vitaliynester avatar vitaliynester commented on August 20, 2024 1

Here is an example epub file. Error occurs from second page

example.epub.zip

from iridium.

jmgeffroy avatar jmgeffroy commented on August 20, 2024 1

OK. Clue. I see (by adding ) that we are inserting Readium stuff at the wrong place (see the <<link below:

   <head><<link rel="stylesheet" type="text/css" href="/readium/readium-css/ReadiumCSS-before.css"/>

Weird. Never happened. I have to check the pattern matching in the HtmlInjector code...

from iridium.

jmgeffroy avatar jmgeffroy commented on August 20, 2024 1

The structure of your HTML seems to defeat our pattern matching. Should be pretty easy to fix, but I need time. I have to switch to other tasks for now, but I'll fix that shortly, probably tomorrow. Sorry for the trouble.

from iridium.

jmgeffroy avatar jmgeffroy commented on August 20, 2024 1

Hi @vitaliynester, I tried a quick fix that seems to work well on your book: on this line, remove the "+ 1", as follows:

    var beginHeadIndex = head.end;

I don't push it for now, I'll wait for your feedback.
I need to have a deep look at this part of the code globally; it definitely requires some love :-)

from iridium.

vitaliynester avatar vitaliynester commented on August 20, 2024 1

This is wonderful! I will try this fix and test it on similar books. Thanks a lot!

from iridium.

Khaled-ElDeeb avatar Khaled-ElDeeb commented on August 20, 2024 1

I have tried this solution and it fixed all the books that I had an issue with, will be testing it for the upcoming week and tell you my feedback, Thanks !

from iridium.

vitaliynester avatar vitaliynester commented on August 20, 2024

This is only in the version with inappwebview, older versions with webview work correctly

from iridium.

jmgeffroy avatar jmgeffroy commented on August 20, 2024

Hi @vitaliynester, can you provide us with a sample epub? Do you see some logs? This really suggests a malformed Epub... But your comment about the previous version (based on WebView) contradicts this feeling...

from iridium.

jmgeffroy avatar jmgeffroy commented on August 20, 2024

OK, I can reproduce the issue on Android and iOS. On iOS, the Webview appears white, without the red paragraph. The chapter2.xhtml source code looks good, I don't see for now what can cause this issue. Investigating...

from iridium.

vitaliynester avatar vitaliynester commented on August 20, 2024

I think the problem is in chapter1.xhtml. When you open it through the editor (VSCode), you can see that block a is highlighted in red. If you open this file in a browser, then the DOM tree looks different. First image - VSCode, second - chrome

image
image

from iridium.

jmgeffroy avatar jmgeffroy commented on August 20, 2024

Thank you for the feedback. These differences are just a pretty-print artifact. VS displays a compact form when the element has no child, I think (<a id:"n_1"/>), while Chrome doesn't. In the book source code, it's written in this compact mode, too.
I checked with validators, chapter1.xhtml is theoretically OK. And it shouldn't impact other chapters (each one is opened in a different webview)... For now, I'm perplexed. But I see an error in the logs:


WebViewScreenState.buildWebViewComponent.<ac>:	 WebView[ERROR]: Uncaught ReferenceError: readium is not defined

Digging...

from iridium.

jmgeffroy avatar jmgeffroy commented on August 20, 2024

More precisely, the wrong generated code is:

      <
      <link rel="stylesheet" type="text/css" href="/readium/readium-css/ReadiumCSS-before.css"/>
      <style>
         audio[controls] {
         width: revert;
         height: revert;
         }
      </style>
      link rel="stylesheet" href="../Styles/book.css" type="text/css" />

Both Readium-specific injected elements are inserted inside the element of the book instead of being inject outside of it!!!

The issue happens somewhere around these lines.

from iridium.

vitaliynester avatar vitaliynester commented on August 20, 2024

I wonder why then it does not work with a particular instance, and not in general? How can this be fixed?

from iridium.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.