The convertToSentenceCase function takes a string and converts the first character of the first word to uppercase but does not convert uppercase characters to lowercase.
String
Result
Expected
Success?
example one
Example one
Example one
✓
Example two
Example two
Example two
✓
Example Three
Example Three
Example three
✗
EXample four
E Xample four
Example four
✗
EXAMPLE FIVE
EXAMPLE FIVE
Example five
✗
Workaround: convert the string to lowercase using Texty Convert to Lowercase or VSCode Transform to Lowercase before using Texty Convert to Sentence Case.
Possible solution: modify Texty convertToSentenceCase to include toLower() before upperFirst().
The
convertToSentenceCase
function takes a string and converts the first character of the first word to uppercase but does not convert uppercase characters to lowercase.Workaround: convert the string to lowercase using Texty
Convert to Lowercase
or VSCodeTransform to Lowercase
before using TextyConvert to Sentence Case
.Possible solution: modify Texty
convertToSentenceCase
to includetoLower()
beforeupperFirst()
.https://github.com/datasert/vscode-texty/blob/fd132cd83e3f02805dc05e632a31ef3e4adeffcf/src/modules/cases.ts#L21
https://github.com/datasert/vscode-texty/blob/fd132cd83e3f02805dc05e632a31ef3e4adeffcf/src/modules/cases.ts#L65