minetest.formspec_escape

From Minetest Developer Wiki
Jump to: navigation, search

Syntax

minetest.formspec_escape(string)

Description

Escapes characters such as [ and ] that can not be used in formspecs. Returns the escaped string.

Example

local code = "This should show up in a textarea []"
meta:set_string("formspec", "size[7,7]"..
	"textarea[1,1;5,5;code;;"..minetest.formspec_escape(code).."]")
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox