Skip to content

Commit

Permalink
Handle lowercase articles when converting to title case from uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
timhor committed Jan 3, 2022
1 parent efb4f48 commit 0a34206
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ export const transformCase = (editor: Editor, caseType: CASE) => {
if (
index > 0 &&
index < allWords.length - 1 &&
LOWERCASE_ARTICLES.includes(word)
LOWERCASE_ARTICLES.includes(word.toLowerCase())
) {
return word;
return word.toLowerCase();
}
return word.charAt(0).toUpperCase() + word.substring(1).toLowerCase();
})
Expand Down

0 comments on commit 0a34206

Please sign in to comment.