@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)