aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMiodec <[email protected]>2024-06-24 14:22:17 +0200
committerMiodec <[email protected]>2024-06-24 14:22:17 +0200
commitc534453a0ad2cc309392d33af0779a6075bbd818 (patch)
tree6bc39d28890d8d1c6c79bcb196bbe947cfb6d0a3
parentd384462496acf5017735e461be6f177e86ad5117 (diff)
downloadmonkeytype-c534453a0ad2cc309392d33af0779a6075bbd818.tar.gz
monkeytype-c534453a0ad2cc309392d33af0779a6075bbd818.zip
fix(punctuation): make sure punctuation characters are placed before newline or tab characters
closes #5522
-rw-r--r--frontend/src/ts/test/words-generator.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/frontend/src/ts/test/words-generator.ts b/frontend/src/ts/test/words-generator.ts
index 72eb26f7f..6438c2aa6 100644
--- a/frontend/src/ts/test/words-generator.ts
+++ b/frontend/src/ts/test/words-generator.ts
@@ -280,6 +280,16 @@ export async function punctuateWord(
) {
word = await applyEnglishPunctuationToWord(word);
}
+
+ if (word.includes("\t")) {
+ word = word.replace(/\t/g, "");
+ word += "\t";
+ }
+ if (word.includes("\n")) {
+ word = word.replace(/\n/g, "");
+ word += "\n";
+ }
+
return word;
}