|
|
#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 10:24 AM. |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,618
Karma: 28549044
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. |
|
|
|
| Advert | |
|
|
|
|
#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. |
|
|
|
|
|
#4 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,618
Karma: 28549044
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Run calibre from source or wait for the next release.
|
|
|
|
|
|
#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.
|
|
|
|
| Advert | |
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| page-break-after avoid not working | scruffs | Amazon Kindle | 50 | 01-27-2023 07:28 AM |
| Alternative to "class=chapter" to force a page break | porphyry5 | Conversion | 6 | 01-27-2022 07:10 PM |
| page-break-after: always not working | franc | ePub | 11 | 03-01-2021 05:33 PM |
| iPad iBooks: page-break-after/inside/before NOT working? | philx | Apple Devices | 7 | 01-27-2013 01:42 AM |