Thread: TOC h2: h3
View Single Post
Old 09-29-2024, 04:04 PM   #11
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,330
Karma: 169098492
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
If you do a search for say, 'title attribute', you will get quite a few hits. One that you may find useful, IMNSHO, is HTML Global title Attribute.

The title attribute is not the same as the title tag.

Sigil and calibre's ebook-editor will use the content of the title="<insert text here>" attribute of the h tag when generating the ToC.

In the examples given, you could use regex to extract the text from the h2 and p tags and concatenate them into a title="whatever" as an attribute of the h2 tag.

Last edited by DNSB; 09-29-2024 at 04:05 PM. Reason: Edit: once again read to end of thread before replying...
DNSB is online now   Reply With Quote