07-31-2022, 09:18 AM | #1 |
Member
Posts: 14
Karma: 7220
Join Date: Dec 2012
Device: Kindle 4NT, Android
|
(page-break-x + feature queries + class selector) not working in CV
Hunting for what I assumed was a bug in one of my books I stumbled upon some strange behaviour in Calibre Viewer. It took me a while to identify the culprit(s) (or better, the combination thereof). I boiled it down to this test file:
Code:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"> <head> <meta charset="utf-8"/> <title>Test</title> <style> p { color: red; } @supports(display: flex) { p {color: green;} } h1 { break-after: avoid; page-break-after: avoid; /* delete here... */ break-inside: avoid; page-break-inside: avoid; /* ...and here... */ } @supports(font-variant-numeric: oldstyle-nums) { p.test {color: blue;} /* ...or remove class */ } </style> </head> <body> <p class="test">Test</p> </body> </html> There would be two ways two make CV understand the second query:
Tested with Calibre 6.2.1 (from PortableApps) and some old 5.x installed version on Windows 10. Last edited by bookworm2000; 07-31-2022 at 09:24 AM. |
07-31-2022, 10:36 AM | #2 |
creator of calibre
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That will take care of it: https://github.com/kovidgoyal/calibr...766da74f5457f4
Note that you will have to reload the book to see the fix. |
07-31-2022, 11:46 AM | #3 |
Member
Posts: 14
Karma: 7220
Join Date: Dec 2012
Device: Kindle 4NT, Android
|
Thank you!
But where should I put render_book.py? I think I tried every subdirectory of the Calibre folder. |
07-31-2022, 11:49 AM | #4 |
creator of calibre
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Run calibre from source or wait for the next release.
|
07-31-2022, 12:11 PM | #5 |
Member
Posts: 14
Karma: 7220
Join Date: Dec 2012
Device: Kindle 4NT, Android
|
Ah, I see. Thank you so much. I will happily wait for the next release.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
page-break-after avoid not working | scruffs | Amazon Kindle | 50 | 01-27-2023 06:28 AM |
Alternative to "class=chapter" to force a page break | porphyry5 | Conversion | 6 | 01-27-2022 06:10 PM |
page-break-after: always not working | franc | ePub | 11 | 03-01-2021 04:33 PM |
iPad iBooks: page-break-after/inside/before NOT working? | philx | Apple Devices | 7 | 01-27-2013 12:42 AM |