View Single Post
Old 02-23-2023, 12:00 PM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,784
Karma: 169712580
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
For the most part when I see chapter headers using p tags, I would create a hidden header item using regex and then create the ToC from the header tags.

source: <p class="chapter">(.*?)</p> <p class="ChapterName">(.*?)</p>

dest: <h3 class="hidden" title="\1: \2">\1: \2</h3> <p class="chapter">\1</p> <p class="ChapterName">\2</p>

<h3 class="hidden" title="Chapter 1: ABCDEF">Chapter 1: ABCDEF</h3>
<p class="Chapter">Chapter 1 </p>
<p class="ChapterName">ABCDEF</p>
DNSB is offline   Reply With Quote