1
0
mirror of https://github.com/mt-mods/signs_lib.git synced 2024-11-09 11:20:19 +01:00

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

This commit is contained in:
1F616EMO~nya 2024-09-07 07:04:15 +08:00 committed by GitHub
parent 4309b3575a
commit 87d65439a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -818,6 +818,9 @@ function signs_lib.update_sign(pos, fields)
local ownstr = ""
if owner ~= "" then ownstr = S("Locked sign, owned by @1\n", owner) end
-- Fix pasting from Windows: CR instead of LF
text = string.gsub(text, "\r\n?", "\n")
meta:set_string("text", text)
meta:set_string("infotext", ownstr..make_infotext(text).." ")