View Single Post
Old 02-10-2024, 01:41 PM   #2
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,160
Karma: 4917718
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Span is not a header, so there is no reason for a conversion to automatically add a span as a TOC level.

Auto-genereated TOC's are created from the <h[1-3]> headers by default.

Forget xpath. Convert your header tags to the correct header tags.

Using a Regex S&R and selecting "all files"
Find... <span class="span2">(.*?)</span>
Replace... <h2>\1</h2>
Best to step through the changes one at a time until you are confident the replace works correctly, then you can Replace All and check the "see what changed" screen to make sure nothing else was picked up in error.

Then style your h2 tag in the CSS.

Then run the TOC generator again after you have deleted all the existing TOC entries so they are not duplicated.

Strange that you ended up with <span> from LO, as I always end up with the correct <h..> tags.
Karellen is offline   Reply With Quote