Use _ as a stand-in for spaces in < completion

Allows to continue typing embeddings, loras and hypernets if they have spaces in their file name
Closes #130
This commit is contained in:
Dominik Reh
2023-03-01 11:13:37 +01:00
parent 647d3f7ec3
commit d1fff7bfa7
3 changed files with 9 additions and 4 deletions

View File

@@ -7,7 +7,8 @@ class HypernetParser extends BaseTagParser {
let tempResults = [];
if (tagword !== "<" && tagword !== "<h:" && tagword !== "<hypernet:") {
let searchTerm = tagword.replace("<hypernet:", "").replace("<h:", "").replace("<", "");
tempResults = hypernetworks.filter(x => 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;
}