fixed challenge script parsing

This commit is contained in:
Jack 2020-12-08 18:40:45 +00:00
parent 78c83f6899
commit 66cc086836

View file

@ -5027,7 +5027,10 @@ async function setupChallenge(challengeName) {
} else if (challenge.type === "script") {
let scriptdata = await fetch("/challenges/" + challenge.parameters[0]);
scriptdata = await scriptdata.text();
customText = scriptdata.split(" ");
text = scriptdata.trim();
text = text.replace(/[\n\r\t ]/gm, " ");
text = text.replace(/ +/gm, " ");
customText = text.split(" ");
customTextIsRandom = false;
setMode("custom", true);
setDifficulty("normal", true);