Skip to content

Commit 70433ce

Browse files
committed
improved custom text preprocessing to remove new line, tab characters and double spaces
1 parent 06c2ce1 commit 70433ce

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

public/js/script.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,8 @@ function focusWords() {
612612

613613
function changeCustomText() {
614614
customText = prompt("Custom text");
615+
customText = customText.replace(/[\n\r\t ]/gm, ' ');
616+
customText = customText.replace(/ +/gm, ' ');
615617
initWords();
616618
}
617619

0 commit comments

Comments
 (0)