From 987f48ae13a5eb12809ad95af022619421653190 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Mon, 16 Jul 2018 22:05:55 +0300 Subject: [PATCH] Fix MOTD trimming --- client/components/MessageTypes/motd.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/components/MessageTypes/motd.vue b/client/components/MessageTypes/motd.vue index 2e7a660d..2f23325d 100644 --- a/client/components/MessageTypes/motd.vue +++ b/client/components/MessageTypes/motd.vue @@ -26,7 +26,10 @@ export default { } // Remove empty lines around the MOTD (but not within it) - return lines.join("\n").trim(); + return lines + .map((line) => line.trimEnd()) + .join("\n") + .replace(/^[\r\n]+|[\r\n]+$/g, ""); }, }, };