diff --git a/javascript/ext_embeddings.js b/javascript/ext_embeddings.js index 409118c..2bfbaf6 100644 --- a/javascript/ext_embeddings.js +++ b/javascript/ext_embeddings.js @@ -12,10 +12,13 @@ class EmbeddingParser extends BaseTagParser { versionString = searchTerm.slice(0, 2); searchTerm = searchTerm.slice(2); } + + let filterCondition = x => x[0].toLowerCase().includes(searchTerm) || x[0].toLowerCase().replaceAll(" ", "_").includes(searchTerm); + if (versionString) - tempResults = embeddings.filter(x => x[0].toLowerCase().includes(searchTerm) && x[1] && x[1] === versionString); // Filter by tagword + tempResults = embeddings.filter(x => filterCondition(x) && x[1] && x[1] === versionString); // Filter by tagword else - tempResults = embeddings.filter(x => x[0].toLowerCase().includes(searchTerm)); // Filter by tagword + tempResults = embeddings.filter(x => filterCondition(x)); // Filter by tagword } else { tempResults = embeddings; } diff --git a/javascript/ext_hypernets.js b/javascript/ext_hypernets.js index aedf9ad..371b85d 100644 --- a/javascript/ext_hypernets.js +++ b/javascript/ext_hypernets.js @@ -7,7 +7,8 @@ class HypernetParser extends BaseTagParser { let tempResults = []; if (tagword !== "<" && tagword !== " x.toLowerCase().includes(searchTerm)); // Filter by tagword + let filterCondition = x => x.toLowerCase().includes(searchTerm) || x.toLowerCase().replaceAll(" ", "_").includes(searchTerm); + tempResults = hypernetworks.filter(x => filterCondition(x)); // Filter by tagword } else { tempResults = hypernetworks; } diff --git a/javascript/ext_loras.js b/javascript/ext_loras.js index 4fb1ce1..2f11fb1 100644 --- a/javascript/ext_loras.js +++ b/javascript/ext_loras.js @@ -7,7 +7,8 @@ class LoraParser extends BaseTagParser { let tempResults = []; if (tagword !== "<" && tagword !== " x.toLowerCase().includes(searchTerm)); // Filter by tagword + let filterCondition = x => x.toLowerCase().includes(searchTerm) || x.toLowerCase().replaceAll(" ", "_").includes(searchTerm); + tempResults = loras.filter(x => filterCondition(x)); // Filter by tagword } else { tempResults = loras; }