Skip to content

Commit

Permalink
Convert CR(LF)s to LFs (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emojigit authored Sep 6, 2024
1 parent 4309b35 commit 87d6543
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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).." ")

Expand Down

0 comments on commit 87d6543

Please sign in to comment.