The Dynamics Of The King’S Island Flood Relief Scheme
This is the sort of thing that happens under existing ST 4200.
I wonder if any tweak is possible to eliminate this erroneous capitalizing after an apostrophe . . .
The Dynamics Of The King’S Island Flood Relief Scheme
This is the sort of thing that happens under existing ST 4200.
I wonder if any tweak is possible to eliminate this erroneous capitalizing after an apostrophe . . .
If you inspect Packages/Default/transform.py
, you will see all the title_case
command does is call Python’s title
method on the string, so the bug is interestingly in Python 3.8
To work around it, open that file with the OverrideAudit plugin and change the relevant line (#38) to return s.title().replace("'S", "'s")
and save it.
Use Override Audit, you can install it from Package Control, and then you’ll see entries in the Command Palette to kxplore the packages
Installed OverrideAudit plugin.
Tools > OverrideAudit > Open Resource > Default > transform.py
Edited return s.title() --> return s.title().replace("'S “, " 's”) and saved.
Tested after restarting machine. Doesn’t work despite the code change.
I note that transform.py function is now referred to within OverrideAudit as transform.py[Override] but that is hardly making a difference.
But your code looks for a space before the apostrophe, and there isn’t one in your text
class TitleCaseCommand(Transformer):
@staticmethod
def transformer(s):
return s.title().replace("'S", "'s")
That is the code in the Python method.
And it doesn’t work.