From ad3fb693af3374a770a2935a3590a7c5fad0cb5c Mon Sep 17 00:00:00 2001 From: Miodec Date: Mon, 18 Jan 2021 17:02:57 +0000 Subject: [PATCH] parsing new line chars for quotes aswell --- src/js/script.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/script.js b/src/js/script.js index 72b36c3d2..d75467280 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -668,6 +668,10 @@ async function initWords() { } randomQuote = rq; randomQuote.text = randomQuote.text.replace(/ +/gm, " "); + randomQuote.text = randomQuote.text.replace(/\\\\t/gm, "\t"); + randomQuote.text = randomQuote.text.replace(/\\\\n/gm, "\n"); + randomQuote.text = randomQuote.text.replace(/\\t/gm, "\t"); + randomQuote.text = randomQuote.text.replace(/\\n/gm, "\n"); randomQuote.text = randomQuote.text.replace(/( *(\r\n|\r|\n) *)/g, "\n "); let w = randomQuote.text.trim().split(" "); for (let i = 0; i < w.length; i++) {