Skip to content

Commit

Permalink
Convert CR(LF)s to LFs
Browse files Browse the repository at this point in the history
  • Loading branch information
Emojigit committed Aug 5, 2024
1 parent 8156b45 commit 6d1b40f
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 6d1b40f

Please sign in to comment.