Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 01-26-2024, 09:36 PM   #1
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Multi-line chapter titles with <br/> and the TOC

I'm finding a lot of chapter titles with a <br/> for a multiline heading

Making a TOC the <br/> is ignored and the lines run together in the TOC

Is there RegEx that I can use, but I think it'd be better if the TOC making code just converted <br/> to a space

I use the Inline TOC option a lot also
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	76
Size:	30.5 KB
ID:	206041  
phossler is offline   Reply With Quote
Old 01-26-2024, 09:40 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: 35,238
Karma: 145277352
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Generally, I add a title="" element to the header tag. I use a simple regex to add the chapter number and text to the title element.
DNSB is offline   Reply With Quote
Old 01-27-2024, 07:55 AM   #3
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
I use a Saved Search to add a space before all my <br> tags:

Code:
Search:  ([a-z.,:;>])<br/>
Replace:  \1 <br/>
enuddleyarbl is offline   Reply With Quote
Old 01-27-2024, 09:33 AM   #4
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: 29,764
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by enuddleyarbl View Post
I use a Saved Search to add a space before all my <br> tags:

Code:
Search:  ([a-z.,:;>])<br/>
Replace:  \1 <br/>
I use the space before the <br /> method. I found doing it after made the second line off center more noticeable.
I use the title= method when I want the TOC to be different than the (Chapter) heading
theducks is online now   Reply With Quote
Old 01-27-2024, 03:13 PM   #5
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Thanks to all --

I added the Hx test since I only wanted this for headings and put it in my Saved Searches

Sometimes there's a digit before the br/, e.g. Chapter 1<br/>Going Home

Find: <([Hh][1-6])>(.*?)<br/>(.*?)</\1>

Replace: <\1>\2 <br/>\3</\1>

(space before the br/ )


It'll probably fail for a 3 line header

IMHO a better solution would be for the TOC module just change <br/> to space
phossler is offline   Reply With Quote
Old 01-27-2024, 05:42 PM   #6
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Good point about the digit (especially for chapter headers). I've updated my saved search to include that:
Code:
([a-z\d.,:;>])<br/>
Thanks.

Actually, now that I think about it, that search should probably be for any non-whitespace character before the <br/> (at least I can't come up with a reason where that wouldn't work):
Code:
(\S)<br/>
enuddleyarbl is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Repeated chapter titles using TOC tool okonek Calibre 9 12-10-2018 08:36 AM
Chapter numbers / titles in ToC ts0329 Conversion 4 02-07-2016 11:13 PM
Ebook chapter titles: with or without chapter number? amoroso Writers' Corner 16 06-14-2011 06:35 AM
Multi-Level TOC edbro Calibre 4 09-16-2010 06:54 PM
Chapter import in the multi-flow redesign ghostyjack Sigil 1 10-23-2009 10:30 AM


All times are GMT -4. The time now is 05:58 AM.


MobileRead.com is a privately owned, operated and funded community.