diff --git a/source/integrations/index.html b/source/integrations/index.html index 919417d90cc..cdbf40701da 100644 --- a/source/integrations/index.html +++ b/source/integrations/index.html @@ -118,8 +118,17 @@ allComponents.pop(); // remove placeholder element at the end function init() { // do the lowerCase transformation once - for (i = 0; i < (allComponents.length); i++) { - allComponents[i].titleLC = allComponents[i].title.toLowerCase(); + for (i = 0; i < allComponents.length; i++) { + title = allComponents[i].title.toLowerCase(); + domain = allComponents[i].domain; + title_normalized = title + .normalize("NFD") + .replace(/[\u0300-\u036f]/g, ""); + title_dedashed = title.replace(/[-_]/g, " "); + title_normalized_dedashed = title_normalized.replace(/[-_]/g, " "); + + allComponents[i].titleLC = title; + allComponents[i].search = `${title} ${title_normalized} ${title_dedashed} ${title_normalized_dedashed} ${domain}`; } // sort the components alphabetically @@ -175,8 +184,10 @@ allComponents.pop(); // remove placeholder element at the end // search through title and category search = decodeURIComponent(hash).substring(8).toLowerCase(); filter = function (comp) { - return (comp.titleLC.indexOf(search) !== -1) || - (comp.cat.find(c => c.includes("#")) != undefined); + return ( + comp.search.indexOf(search) !== -1 || + comp.cat.find((c) => c.includes("#")) != undefined + ); }; } else if (hash === '#featured' || hash === '') {