View Single Post
Old 01-11-2011, 01:24 PM   #1
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
fixing up chapter numbers

i often find books that have chapter starts as numbers in bold, and i need them to be in H1 or H2 tags in order to calibre to detect and build TOC.

is there any sigil - regex find replace command that could pick out lines like
Code:
<p class="calibre8"><span class="calibre3 bold">7</span></p>
and replace with
Code:
  <h2>7</h2>
for all instances of 1 or 2 digit numbers ?

the numbering of the calibre tags varies from book to book but I'm happy to set those up once per book

the construction p class="calibre8"><span class="calibre3 bold" does not occur outside of chapter headers so that can be replaced with h2, but I then have to also replace the end of string p with h2 & that is what has me beat.

Last edited by cybmole; 01-11-2011 at 01:30 PM.
cybmole is offline   Reply With Quote