View Single Post
Old 06-27-2020, 08:22 PM   #24
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,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
@Ted - Your PM

I actually run two steps: one to upper case headings, and then a second to title case them

These are my saved searches and this is the function listing for 'Title case text - Ignore tags'

Code:
from calibre.utils.titlecase import titlecase
from calibre.ebooks.oeb.polish.utils import apply_func_to_html_text

def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
    '''Title-case matched text, ignoring the text inside tag definitions.'''
    return apply_func_to_html_text(match, titlecase)
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	207
Size:	237.9 KB
ID:	180240   Click image for larger version

Name:	Capture2.JPG
Views:	215
Size:	255.6 KB
ID:	180241  
phossler is offline   Reply With Quote