fixed replace only replacing one match

This commit is contained in:
Miodec 2023-01-24 02:25:38 +01:00
parent 3c182e70d3
commit 88a515cefd

View file

@ -997,7 +997,7 @@ export async function init(): Promise<void> {
TestWords.setHasTab(true);
}
const te = randomWord.replace("\n", "\n ").trim();
const te = randomWord.replace(/\n/g, "\n ").replace(/ $/gm, "");
if (/ +/.test(te)) {
const randomList = te.split(" ");