mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-06 13:55:19 +08:00
fixed challenge script parsing
This commit is contained in:
parent
78c83f6899
commit
66cc086836
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue