From f1fcec43c0362f9d61f84a90dbdf430cfa998d1b Mon Sep 17 00:00:00 2001 From: Justin Oro Date: Fri, 11 Sep 2026 12:47:55 -0700 Subject: [PATCH] Fix sons of the forest map path and strip punctuation from wiki search terms --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 3f91d32..49b4e75 100644 --- a/index.js +++ b/index.js @@ -118,12 +118,12 @@ const MAP_SEARCH_FILLER_PHRASES = [ const MAP_SEARCH_STOPWORDS = /\b(the|a|an|on|in|for|of|to|at|near|can|i|do|does|find|get)\b/g; function extractMapSearchTerm(query, gameName) { - let text = normalizeTitle(query); - if (gameName) text = text.split(gameName).join(" "); + let text = normalizeTitle(query).replace(/'/g, ""); + if (gameName) text = text.split(gameName.replace(/'/g, "")).join(" "); MAP_SEARCH_FILLER_PHRASES.forEach((pattern) => { text = text.replace(pattern, " "); }); - text = text.replace(MAP_SEARCH_STOPWORDS, " ").replace(/\s+/g, " ").trim(); + text = text.replace(MAP_SEARCH_STOPWORDS, " ").replace(/[^a-z0-9\s-]/g, " ").replace(/\s+/g, " ").trim(); return text; }