![]() |
#1 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
ePub -> AZW3 bug: inline ToC gets wrong styles
Converting an ePub to AZW3 with a calibre-generated inline ToC, I notice that the entries have bullets next to them in the converted output. The problem seems to be that the list elements are given a style called "calibre5" which is defined in "0002.css", but the file has a link to "stylesheet.css" (which existed in the original ePub, but was renamed during the conversion).
Here is what was in the ePub to start with: Code:
<title>Table of Contents</title> <style type="text/css"> li { list-style-type: none; padding-left: 0; text-indent: -2em; margin-left: 3em; } a { text-decoration: none; } a:hover { color: red; } h2 { font-size: 1.2em; text-align: center; margin: 2em; } </style> </head> <body id="calibre_generated_inline_toc"> <h2>Table of Contents</h2> <ul class="level1"> <li><a href="OEBPS/Text/part01.htm">Blah blah blah</a></li> Code:
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/> <link href="../../page_styles.css" rel="stylesheet" type="text/css"/> </head> <body class="calibre4" id="calibre_generated_inline_toc"> <h2 class="calibre3" id="UGI1-4fea6e757c1d4c01a3ff37dcdd3f221e">Table of Contents</h2> <ul class="level"> <li class="calibre5"><a class="pcalibre calibre6" href="part0002.html#1T142-4fea6e757c1d4c01a3ff37dcdd3f221e">Blah blah blah</a></li> |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
IIRC the generated inline toc in azw3 output has none of that. What you are looking at looks to be a remnant from a conversion of an azw3 with an existing inline toc to epub and then back to azw3. I suggest deleting it from the epub in the editor and re-running the conversion.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
Any conversion which creates links to non-existent files is surely a bug. |
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
This is what I get for failing to follow my own SOP.
See https://www.mobileread.com/forums/sho...d.php?t=186697 |
![]() |
![]() |
![]() |
#5 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
I have done some experiments and discovered a fix, which may in turn suggest the cause of the bug.
The HTML files in the book are in a directory called OEBPS/Text. The inline ToC that Calibre generates is placed in the root directory, and the symptoms on conversion are then as I describe. However, renaming the ToC to be OEBPS/Text/toc.xhtml fixes the problem. This suggests that the conversion is struggling with files in the root directory. Note that the links are to CSS files in "../..". This suggests to me that the initial conversion from EPUB to internal XHTML generated these links, and the output conversion to EPUB ignored them. The stylesheet files in the ePUB are in OEBPS/Styles, by the way, so the correct way of referring to them would be "../Styles/stylesheet.css". The AZW3 has all the HTML in a directory called "text" and the CSS is in "styles". It seems that either the inline ToC generatior should put the file in the same directory as the other HTML files, or the conversion from EPUB should handle HTML files in a mix of directories correctly, or (ideally) both. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Once again, I suggest you stop speculating and just follow the steps outlined in
https://www.mobileread.com/forums/sho...d.php?t=186697 |
![]() |
![]() |
![]() |
#7 | |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
|
|
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You need to open a bug report. This problem is almost certainly a case of GIGO.
|
![]() |
![]() |
![]() |
#9 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Sigh. OK, reported as bug #1474287, with attached ePUB which converts incorrectly.
|
![]() |
![]() |
![]() |
#10 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,443
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Gazumped. Post no longer useful...
|
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Ahh, now I get it. You are talking about the insert inline toc function in the editor, not the one in the conversion pipeline.
|
![]() |
![]() |
![]() |
#12 | |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
Now all I have to do is check and reconvert a pile of stuff when the next release comes out... :-( |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Epub to AZW3, TOC margins off, text OK | Ma'am-I-Am | Conversion | 0 | 10-18-2014 07:40 PM |
azw3 to epub - structure detection bug ? | cybmole | Conversion | 6 | 02-02-2014 07:24 PM |
Inline Styles and Overrides | ukzembla | Kindle Formats | 2 | 01-18-2012 07:06 AM |
Bug Report: Mobi Conversion puts TOC Nav in wrong spot | therealjoeblow | Conversion | 4 | 12-02-2011 09:56 AM |
Use Regex to Code an Inline TOC, from an External TOC's .ncx File | mostlynovels | ePub | 2 | 03-16-2011 12:15 PM |