View Single Post
Old 10-06-2018, 03:22 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,973
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I use the TOC tool in the Editor (or main Calibre toolbar )
But that is some ugly code (
Code:
<p class="calibre_12"><font size="4"><span class="bold">Chapter I</span></font></p><p class="calibre_12">- AT MAYTREE COTTAGE</p>
)

font sizing should be done in the CSS. <h tags are bold by default

First step is to 'pretty' the code using the flower icon (main toolbar) in the editor so any pattern match has a better chance


Personally, I would code this as:
Code:
<h3 class="chapno">Chapter I&nbsp<br />- AT MAYTREE COTTAGE</h3>
This creates a 2 line Visual, but shows up in the TOC as a single entry

where .chapno in the CSS would control the style
line-height: 2 ; spreads the lines further apart

I think this EDITOR REGEX search may work. (Replace and Search, NEVER all)

Find <p class="calibre_12"><font size="4"><span class="bold">(Chapter .+?)</span></font></p><p class="calibre_12">(- .+?)</p>

Replace <h3 class="chapno">\1&nbsp<br />\2</h3>
theducks is offline   Reply With Quote