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

Problem converting tables from Royal Road #1455

Closed
bardokhofmeier896 opened this issue Sep 3, 2024 · 19 comments
Closed

Problem converting tables from Royal Road #1455

bardokhofmeier896 opened this issue Sep 3, 2024 · 19 comments

Comments

@bardokhofmeier896
Copy link

bardokhofmeier896 commented Sep 3, 2024

Describe the bug
I read a lot of LitRpg and they startet adding html table for ingame status messages. These messages, if to long, don't convert properly and can't be read on my reader.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://www.royalroad.com/fiction/84708/the-gate-traveler-slice-of-life-litrpg'
  2. Convert to epub
  3. Copy to Reader (I have a Tolino Shine 3)
  4. Go to [Chapter 8: My Second Gate]
  5. There is a lenghty explanation of the other world that is cut.

Expected behavior
I want to read the whole text of the box.

Screenshots
Page with the table:
2024-09-03-08-40-30-897

Next page:
2024-09-03-08-40-37-493

Actual content of the box:
image

If i open the book in calibre it's also cut at the same point.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Vivaldi (Chromium), also with Firefox 129.0.2 (64-Bit)
  • Version 6.9.3447.37 (Stable channel) (64-Bit)
@dteviot
Copy link
Owner

dteviot commented Sep 4, 2024

@bardokhofmeier896

I'm not sure I can help you. I just tried to download an view that chapter.
The epub file created by WebToEpub does have all that text. You could unzip the epub and look at the chapter file with a text viewer, or a browser and you should see all the text is there.

I have seen similar problems (as your Tolino Shine 3) with the table being cut in Edge, when it use to support epubs. So, I think it's a flaw in your viewer's handling of a table, it only shows as much of the table as will fit on a page.

I tried viewing it in Calibre, and all the text appears.
I don't know why it doesn't appear for you, but I would guess that you've asked Calibre to convert to some format that results in the tables being stripped. You could try this epub reader. https://www.epubread.com/en/
image

@gamebeaker
Copy link
Collaborator

gamebeaker commented Sep 4, 2024

I also have a tolino shine 3 and wrote to the tolino support, if i get a response i am going to post it here. Here is the test epub file i created to simulate the problem https://nx39171.your-storageshare.de/s/42djZXf5ESZPFXb (The funny thing is if you open the epub in the browser->click "..." -> "Open in Onlyoffice" it is displayed correct).
The tolino webreader has the same problem so i guess it is a implementation problem from tolino and not from WebToEpub.

@bardokhofmeier896
Copy link
Author

So i tested a bit, and calibre indeed does show the whole text, if i maximize the windows of the reader. I never read on my pc so it was still at the default size, which is small.
@gamebeaker Thanks for that.

@gamebeaker
Copy link
Collaborator

No response from tolino just found this reddit thread.
https://www.reddit.com/r/tolino/comments/1fbue63/where_to_report_bugs/

@dteviot
Copy link
Owner

dteviot commented Sep 13, 2024

@bardokhofmeier896

Thought occurs, I could probably throw something together for EpubEditor to reformat the table as ordinary text. Not sure it that would be acceptable for you or not.

@bardokhofmeier896
Copy link
Author

Hi, i mean that would be way better than not being able to read it.
Ideally you could make it cursive (or some other marker), so i would be visible that it was a block.

@bardokhofmeier896
Copy link
Author

@gamebeaker
I got a response from tolino which sums up to: They won't fix it or find a workaround in the forseable future.

@gamebeaker
Copy link
Collaborator

I just made a test with this website: https://www.academicblock.com/technology/web-tools/table-to-div-convertor
And the table gets shown correctly in the reader after the table got converted to divs.

@gamebeaker
Copy link
Collaborator

@dteviot i am not sure how to implement this should the user have the ability to choose if it gets converted or not?
The table can look bad if it is converted to div:
original:
image
converted to div:
image

@gamebeaker
Copy link
Collaborator

gamebeaker commented Sep 26, 2024

@bardokhofmeier896 i made a fix you have to install the test version.

Test versions for Firefox and Chrome have been uploaded to https://github.com/dteviot/WebToEpub/releases/tag/developer-build. Pick the one suitable for you, follow the "How to install from Source (for people who are not developers)" instructions at https://github.com/dteviot/WebToEpub/tree/ExperimentalTabMode#user-content-how-to-install-from-source-for-people-who-are-not-developers and let me know how it goes.
Tested with:

and add in the Stylesheet:

.WebToEpub-table {
    border-collapse: collapse;
    width: 100%;
}
.WebToEpub-row {
    display: flex;
    border: 1px solid black;
}
.WebToEpub-cell {
    flex: 1;
    padding: 5px;
    border: 1px solid black;
}

this will convert the tables to divs with a little styling.

@dteviot
Copy link
Owner

dteviot commented Sep 26, 2024

@gamebeaker
I'm going to say, this isn't something for WebToEpub to do. Instead, should provide a script in EpubEditor.

@dteviot
Copy link
Owner

dteviot commented Sep 27, 2024

@gamebeaker
My design "concept" was that WebToEpub is responsible for fetching the content and creating an Epub with the minimum necessary transformation of the original content. Making irreversible transforms of the content is not desirable.
If users need/want something more, then they should use another tool afterwards.

I want to keep WebToEpub as simple and minimal as possible.
Adding additional features usually means having to deal with more and more edge cases over time.

Also, I'm really not comfortable with the feature being turned on by adding values to the stylesheet. It's:
a) Impossible for someone to discover on their own.
b) Going to surprise me in a few years when I go trying to tell someone how to turn it on in the future.
c) May be broken if someone does their own custom stylesheet. (I know a couple of people do.)

However, you've done this work, it's not a big piece of code, and it obviously solves a problem.

So, I'm going to split the baby and propose: make it a full feature. But if it causes problems in the future, I'll remove it (and provide a EpubEditor script.) So, additional work needed.

  1. Add an entry under "Advanced Options" to turn it on, so it's discoverable.
  2. Add the stylesheet elements to the default stylesheet. (actually I'm not sure this solves (c) above. Oh well.)

@gamebeaker
Copy link
Collaborator

@dteviot i could move the stylesheet directly into the generated html.
Problem: user is unable to edit the table stylesheet for the table.

@bardokhofmeier896
Copy link
Author

@dteviot @gamebeaker This works like a charm.
The Table is properly displayed over 3 pages and i noticed no siteeffects.

@dteviot
Copy link
Owner

dteviot commented Sep 27, 2024

@gamebeaker

i could move the stylesheet directly into the generated html.

I think you're suggesting have WebToEpub add this to the stylesheet when feature is turned on?
My opinion is keep it simple, just add it to the default stylesheet. So it will always be there... Unless someone modifies the stylesheet themselves. In which case, they probably know what they're doing.

@gamebeaker
Copy link
Collaborator

@dteviot i thought more of something like this in the HTML.
<p style="color:red;">This is a paragraph.</p>
I think it is called inline css .
Your solution would be better as in power user can customize it.

In which case, they probably know what they're doing.

yea

@dteviot
Copy link
Owner

dteviot commented Oct 9, 2024

@bardokhofmeier896

Thanks to gamebeaker, EpubEditor is now available at https://dteviot.github.io/EpubEditor/, no need to download, unpack, etc.
He also added in the ability to modify tables.

@gamebeaker
Copy link
Collaborator

@bardokhofmeier896 The fix for royalroad got removed from WebToEpub you now need to use EpubEditor to convert the tables for better readability.
Simple "upload" your epub and click "Convert royalroad Table to Div (better tolino readability)"
image
The epub doesn't get uploaded to a server all changes happen completely locally in your browser.

@bardokhofmeier896
Copy link
Author

That works for me, thanks a lot for all the work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants