From 78657697175dcb9f00715447f7048b007e45800b Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Wed, 4 Sep 2024 10:34:30 +0200 Subject: [PATCH 1/2] 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; From a1f602d836ec37cc3327fb1c4f5163f21f6b9ef9 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Wed, 4 Sep 2024 10:36:32 +0200 Subject: [PATCH 2/2] add changeset --- .changeset/selfish-eagles-train.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/selfish-eagles-train.md diff --git a/.changeset/selfish-eagles-train.md b/.changeset/selfish-eagles-train.md new file mode 100644 index 000000000..fd97c577d --- /dev/null +++ b/.changeset/selfish-eagles-train.md @@ -0,0 +1,5 @@ +--- +"@solid-primitives/marker": minor +--- + +fix memory leak