(fix: filter search) trim keyword pre processing

This commit is contained in:
ManishMadan2882
2024-12-09 12:47:13 +05:30
parent 17a176ad4e
commit 7c3f80f13d

View File

@@ -35,7 +35,7 @@ export const preprocessSearchResultsToHTML = (text: string, keyword: string) =>
const filteredResults = document.createElement("div");
filteredResults.innerHTML = htmlString;
if (!processNode(filteredResults, keyword)) return null;
if (!processNode(filteredResults, keyword.trim())) return null;
return filteredResults.innerHTML.trim() ? filteredResults.outerHTML : null;
};