View Single Post
Old 01-12-2026, 02:03 PM   #19
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,440
Karma: 6733960
Join Date: Nov 2009
Device: many
In case this helps. Here is a python function replacement to force titlecase even when the entire string is all caps.

Code:
def replace(match, number, file_name, metadata, data):
    if match:
        new_match = match
        new_match.string = replace_lowercase(match, number, file_name, metadata, data)
        return replace_titlecase(new_match, number, file_name, metadata, data)
And so I used the Python Function Replace editor to create a new replacement function I called "force_titlecase"

And then my replace string becomes:

\F<force_titlecase>

If you edit this be careful not to introduce tabs in place of spaces as this is entirely indented in groups of 4 spaces.

Hope this helps.

With this replacement function even the string "DOWN THE RABBIT-HOLE" which should be skipped by normal titlecase calls will be coverted to "Down the Rabbit-Hole".

Last edited by KevinH; 01-12-2026 at 02:06 PM.
KevinH is offline   Reply With Quote