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 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;