From 0f6624f5a5240baa45156d5e2d29c0688ea28706 Mon Sep 17 00:00:00 2001 From: 1F616EMO~nya Date: Sat, 7 Sep 2024 07:04:09 +0800 Subject: [PATCH] Convert CR(LF)s to LFs (#19) --- signs_api/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/signs_api/init.lua b/signs_api/init.lua index ef3b81c..a75570d 100644 --- a/signs_api/init.lua +++ b/signs_api/init.lua @@ -28,6 +28,8 @@ local FS = function(...) return minetest.formspec_escape(S(...)) end function signs_api.set_display_text(pos, text, font) local meta = minetest.get_meta(pos) + -- Fix pasting from Windows: CR instead of LF + text = string.gsub(text, "\r\n?", "\n") meta:set_string("display_text", text) if text and text ~= "" then meta:set_string("infotext", "\""..text.."\"")