We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53d3317 commit 1c2b319Copy full SHA for 1c2b319
1 file changed
public/js/script.js
@@ -190,7 +190,8 @@ function addWord() {
190
let language = words[config.language];
191
let randomWord = language[Math.floor(Math.random() * language.length)];
192
previousWord = wordsList[wordsList.length - 1];
193
- while (randomWord.indexOf(' ') > -1 || (!config.punctuation && randomWord == "I") || randomWord.indexOf(' ') > -1) {
+ previousWordStripped = previousWord.replace(/[.?!":\-,]/g,'').toLowerCase();
194
+ while (previousWordStripped == randomWord || randomWord.indexOf(' ') > -1 || (!config.punctuation && randomWord == "I")) {
195
randomWord = language[Math.floor(Math.random() * language.length)];
196
}
197
if (config.punctuation && config.mode != "custom"){
0 commit comments