diff options
author | kwolekr <kwolekr@minetest.net> | 2013-02-24 16:00:35 -0500 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2013-03-05 23:25:02 -0500 |
commit | ba78194636a9a498f6979cc21cd39399f23d658a (patch) | |
tree | 7cad8f0234fe4f7ff45807364b4c275296982805 /builtin | |
parent | bdbdeab0053d9ebbaffea17effeba777b710d390 (diff) | |
download | minetest-ba78194636a9a498f6979cc21cd39399f23d658a.tar.gz minetest-ba78194636a9a498f6979cc21cd39399f23d658a.tar.bz2 minetest-ba78194636a9a498f6979cc21cd39399f23d658a.zip |
Allow any character in formspec strings with escape char
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/misc.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/misc.lua b/builtin/misc.lua index e018aff85..496435b33 100644 --- a/builtin/misc.lua +++ b/builtin/misc.lua @@ -99,3 +99,10 @@ function minetest.setting_get_pos(name) return minetest.string_to_pos(value) end +function minetest.formspec_escape(str) + str = string.gsub(str, "\\", "\\\\") + str = string.gsub(str, "%[", "\\[") + str = string.gsub(str, "%]", "\\]") + return str +end + |