From d4e91ea9a68c8bfebe6a1000b47023fc3ed2dd5b Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Mon, 13 Nov 2023 13:56:54 +0000 Subject: [PATCH] Stricter search that doesn't ignore all punctuation. --- frontend/src/utils/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts index e8cf947..870ffca 100644 --- a/frontend/src/utils/index.ts +++ b/frontend/src/utils/index.ts @@ -86,7 +86,7 @@ export function haystackFormat(str: string) { // Preformat search string for faster search export function needleFormat(query: string) { const based = query.normalize('NFKD').replace(/[\u0300-\u036f]/g, '').toLowerCase() - return {based, words: based.split(/\W+/)} + return {based, words: based.split(/\s+/)} } // Test if haystack includes needle