From 6f9a0a672a9c40dc29badf8642eeac1b4c738c13 Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Sun, 15 Nov 2020 10:05:27 +0100 Subject: [PATCH] Disabling space replacer for now - a performance nightmare with (probably) small benefit --- qml/js/functions.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/qml/js/functions.js b/qml/js/functions.js index 5a71999..ae90266 100644 --- a/qml/js/functions.js +++ b/qml/js/functions.js @@ -298,15 +298,15 @@ function enhanceMessageText(formattedText) { messageText = messageText.replace(new RegExp("\r?\n", "g"), "
"); - var spaceRegex = /\s{2,}/g; - function spaceReplacer(match, p1, offset, string) { - var replaceString = ""; - for (var i = 0; i < match.length; i++) { - replaceString += " "; - } - return replaceString; - } - messageText = messageText.replace(spaceRegex, spaceReplacer); +// var spaceRegex = /\s{2,}/g; +// function spaceReplacer(match, p1, offset, string) { +// var replaceString = ""; +// for (var i = 0; i < match.length; i++) { +// replaceString += " "; +// } +// return replaceString; +// } +// messageText = messageText.replace(spaceRegex, spaceReplacer); return messageText;