From c4aa5448374a75947b9caa8b834cb9b6fbd566b3 Mon Sep 17 00:00:00 2001 From: Misaka_L Date: Sat, 25 Jan 2025 18:51:37 +0000 Subject: [PATCH] fix: crash when content contains a period connected with a quotation marks --- src/rules/case-abbrs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rules/case-abbrs.ts b/src/rules/case-abbrs.ts index bedcc86..696bb5f 100644 --- a/src/rules/case-abbrs.ts +++ b/src/rules/case-abbrs.ts @@ -49,7 +49,7 @@ const matchAbbr = ( // get the next matching abbr chars by removing the last char and filtering const matchedAbbrChars = reversedAbbrChars .filter( - (abbr) => abbr[0].toLowerCase() === tokenBefore.value.toLowerCase() + (abbr) => tokenBefore.value && abbr[0].toLowerCase() === tokenBefore.value.toLowerCase() ) .map((abbr) => abbr.slice(1))