From 5209b12d448a91a00099594f0c4badef2927361f Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Mon, 16 Jul 2018 20:54:47 +0300 Subject: [PATCH] Fix MOTD display to actually only trim new lines --- client/js/render.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/js/render.js b/client/js/render.js index 3fd6cec6..ddde4400 100644 --- a/client/js/render.js +++ b/client/js/render.js @@ -112,7 +112,10 @@ function buildChatMessage(msg) { } // Remove empty lines around the MOTD (but not within it) - msg.text = lines.join("\n").trim(); + msg.text = lines + .map((line) => line.trimEnd()) + .join("\n") + .replace(/^[\r\n]+|[\r\n]+$/g, ""); } const renderedMessage = $(templates[template](msg));