View Single Post
Old 10-18-2020, 01:26 AM   #1
snarkophilus
Wannabe Connoisseur
snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.
 
Posts: 426
Karma: 2516674
Join Date: Apr 2011
Location: Geelong, Australia
Device: Kobo Libra 2, Kobo Aura 2, Sony PRS-T1, Sony PRS-350, Palm TX
Chapter detection for azw3 to <anything>

Hi folks,

I've got a number of books from Amazon recently where each chapter has two heading tags which results in the default calibre conversion splitting the first part of a new chapter title into its own page and the second part on the next page with the rest of the chapter text. This is an example of the html:

Code:
    <div class="heading heading-with-title heading-without-image" id="chapter-1-heading" aid="3Q282">
      <div class="heading-contents" aid="3Q283">
        <div class="title-subtitle-block title-block-with-element-number" aid="3Q284">
          <div class="element-number-block" aid="3Q285">
            <h2 class="element-number" aid="3Q286">1</h2>
          </div>
          <div class="title-block" aid="3Q287">
            <h1 class="title" aid="3Q288">Descent</h1>
          </div>
        </div>
      </div>
    </div>
I know I can tinker with the "Detect chapters" XPath stuff in the structure detection options in the coversion dialogs, but I was wondering if the default XPath could be made smarter somehow to pick these cases up. I don't XPath enough to know if this is possible.

The attached zip files contains an example from "Colony Mars One" extracted with mobiunpack and reduced to just a simple example that shows the problem when run with ebook-convert.exe .
Attached Files
File Type: zip mars.zip (874 Bytes, 208 views)
snarkophilus is offline   Reply With Quote