From 6faea7f93d00c594efa62e065a772af040e8d7d3 Mon Sep 17 00:00:00 2001 From: Aisu Wata Date: Thu, 4 May 2023 13:23:00 -0300 Subject: [PATCH] Fixed newlines getting eaten --- public/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index 5df017fe6..00af8459c 100644 --- a/public/script.js +++ b/public/script.js @@ -2400,7 +2400,7 @@ function cleanUpMessage(getMessage, isImpersonate) { // trailing invisible whitespace before every newlines, on a multiline string // "trailing whitespace on newlines \nevery line of the string \n?sample text" -> // "trailing whitespace on newlines\nevery line of the string\nsample text" - getMessage = getMessage.replace(/\s+$/gm, ""); + getMessage = getMessage.replace(/[^\S\r\n]+$/gm, ""); if (is_pygmalion) { getMessage = getMessage.replace(//g, name1); getMessage = getMessage.replace(//g, name2);