mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Allow any character in formspec strings with escape char
This commit is contained in:
parent
bdbdeab005
commit
ba78194636
5 changed files with 129 additions and 56 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue