Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-26-2024, 10: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,085
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:	149
Size:	30.5 KB
ID:	206041  
phossler is offline   Reply With Quote
Old 01-26-2024, 10: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: 40,506
Karma: 156983616
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, 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, 08: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: 751
Karma: 1537886
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, 10: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: 30,443
Karma: 58055868
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 offline   Reply With Quote
Old 01-27-2024, 04: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,085
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, 06: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: 751
Karma: 1537886
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


Forum Jump

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


All times are GMT -4. The time now is 04:28 AM.


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