Removed wildcard comments

https://github.com/Klokinator/UnivAICharGen uses # for comments within the wildcards
This commit is contained in:
Joris Neuteboom
2022-10-30 16:10:38 +01:00
committed by GitHub
parent 524514bd46
commit f7f5101f62

View File

@@ -437,7 +437,7 @@ async function autocomplete(textArea, prompt, fixedTag = null) {
wcPair = wildcardExtFiles.find(x => x[1].toLowerCase() === wcFile);
let wildcards = (await readFile(`file/${wcPair[0]}/${wcPair[1]}.txt`)).split("\n")
.filter(x => x.trim().length > 0); // Remove empty lines
.filter(x => x.trim().length > 0 && !x.startsWith('#')); // Remove empty lines and comments
results = wildcards.filter(x => (wcWord !== null && wcWord.length > 0) ? x.toLowerCase().includes(wcWord) : x) // Filter by tagword
.map(x => [wcFile + ": " + x.trim(), "wildcardTag"]); // Mark as wildcard
@@ -746,4 +746,4 @@ onUiUpdate(async function () {
}
gradioApp().appendChild(acStyle);
styleAdded = true;
});
});