From ea89778e5055a1efb1d38f276ba300e55340c5d5 Mon Sep 17 00:00:00 2001 From: "Laetitia (O-01-67)" <68935009+O-01-67@users.noreply.github.com> Date: Mon, 12 Dec 2022 11:01:13 -0500 Subject: [PATCH] space to _ for prompt inputs --- mods/generator_prompt.js | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/mods/generator_prompt.js b/mods/generator_prompt.js index c8b2bfc8..180f201c 100644 --- a/mods/generator_prompt.js +++ b/mods/generator_prompt.js @@ -85,20 +85,22 @@ elements.generator_prompt = { }; function parseForLateGenerationParameter(input) { - if(typeof(input) === "string") { //it should be an array, so string check - //console.log("String detected"); - if(input.includes(",")) { //comma-separated string? - //console.log("Splitting string to array"); - input = input.split(","); //,SS to array - } else { - //console.log("Wrapping string in array"); - input = [input]; //single string to array - }; - }; - for(i = 0; i < input.length; i++) { - if(input[i].includes("+")) { - input[i] = input[i].split("+") - }; - }; - return input; + if(typeof(input) === "string") { //it should be an array, so string check + input = input.replace(/ /g,"_"); + //console.log("String detected"); + if(input.includes(",")) { //comma-separated string? + //console.log("Splitting string to array"); + input = input.split(","); //,SS to array + } else { + //console.log("Wrapping string in array"); + input = [input]; //single string to array + }; + }; + for(i = 0; i < input.length; i++) { + input[i] = input[i].replace(/ /g,"_"); + if(input[i].includes("+")) { + input[i] = input[i].split("+") + }; + }; + return input; };