Skip to content

Commit

Permalink
Convert CR(LF)s to LFs (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emojigit authored Sep 6, 2024
1 parent 8156b45 commit 0f6624f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions signs_api/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.."\"")
Expand Down

0 comments on commit 0f6624f

Please sign in to comment.