From 78657697175dcb9f00715447f7048b007e45800b Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Wed, 4 Sep 2024 10:34:30 +0200 Subject: [PATCH] fix: makeSearchRegex Memory leak (due to empty capture) --- packages/marker/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/marker/src/index.ts b/packages/marker/src/index.ts index eedbaaf66..39cbcaf16 100644 --- a/packages/marker/src/index.ts +++ b/packages/marker/src/index.ts @@ -16,7 +16,7 @@ export function makeSearchRegex(search: string): RegExp { return search ? new RegExp( // join words `|` to match any of them - search.replace(SPLIT_WORDS_REGEX, "|"), + search.trim().replace(SPLIT_WORDS_REGEX, "|"), "gi", ) : NEVER_REGEX;