From e8d4077c42d7d91f6609baa27142e346770b1bd6 Mon Sep 17 00:00:00 2001 From: Athozus Date: Thu, 7 Dec 2023 23:49:04 +0100 Subject: [PATCH] Simplify interleaving function Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com> --- ui/message.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ui/message.lua b/ui/message.lua index 237a87c..ada5e66 100644 --- a/ui/message.lua +++ b/ui/message.lua @@ -4,12 +4,7 @@ local S = minetest.get_translator("mail") local FORMNAME = "mail:message" local function interleaveMsg(body) - local lines = (body or ""):split("\n", true) - local il_lines = {} - for _,l in ipairs(lines) do - il_lines[#il_lines+1] = "> " .. l - end - return table.concat(il_lines, "\n") + return "> " .. (body or ""):gsub("\n", "\n> ") end