Skip to content

Commit

Permalink
Fix vs. restart sentence
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Sep 30, 2023
1 parent 1eb31e8 commit 7cfc341
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/titles/titleFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ function isDelimeter(word: string): boolean {
return (word.match(/^[-:;~—|]$/) !== null
|| word.match(/[:?.!\]]$/) !== null)
&& !listHasWord(allowlistedWords, word)
&& !listHasWord(titleCaseNotCapitalized, word) // vs. ft.
&& (!isAcronymStrict(word) || !word.endsWith("."));
}

Expand Down
1 change: 1 addition & 0 deletions test/titleFormatter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ describe("toSentenceCase", () => {
["I want to go to the U.S.", "I want to go to the U.S."],
["I want to go to the U.S. to see a movie", "I want to go to the U.S. to see a movie"],
["I want to go to the U.S! they have movies there", "I want to go to the U.S. They have movies there"],
["Nose slice VFX - pracical vs. digital effect", "Nose slice VFX - Pracical vs. digital effect"],
];
for (const testCase of sentenceCases) {
const [input, expected] = testCase;
Expand Down

0 comments on commit 7cfc341

Please sign in to comment.