From 0a34206f1a8396f3ac69ca6c1127a71de4fb91c6 Mon Sep 17 00:00:00 2001 From: Tim Hor Date: Mon, 3 Jan 2022 15:11:14 +1100 Subject: [PATCH] Handle lowercase articles when converting to title case from uppercase --- actions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions.ts b/actions.ts index 731ba25..90f93d7 100644 --- a/actions.ts +++ b/actions.ts @@ -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(); })