Thanks Kovid. A comprehensive solution very quickly. I probably should have brought it to your attention in a private bug report.
It seems the mystery is solved. The TOC is produced from lines like the following. I don't know exactly what the aid= tags do, though they seem to be sequentially numbered as used. But then in the second example, chapter 1, the use of 1G following 1F is strange. I had thought the numbers were hexadecimal.
<h1 style="margin:0.00% 0.00%; page-break-before:always; line-height:150%; " aid="12"><span style=" font-size:1.2rem; font-weight:bold" aid="13">Prologue</span></h1>
<h1 style="margin:0.00% 0.00%; page-break-before:always; line-height:150%; " aid="1G"><span style=" font-size:1.2rem; font-weight:bold" aid="1H">Chapter 1</span></h1>
In any case, it seems to be fixed. Calibre now creates a working toc.ncx and links work in calibre viewer. As eschwartz says, KindleUnpack now needs corresponding alterations.
Thanks to everyone who took an interest.
|