1
0
mirror of https://github.com/pyrollo/display_modpack.git synced 2025-10-16 17:15:22 +02:00

Convert CR(LF)s to LFs (#19)

This commit is contained in:
1F616EMO~nya
2024-09-07 07:04:09 +08:00
committed by GitHub
parent 8156b45724
commit 0f6624f5a5

View File

@@ -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.."\"")