mirror of
https://gitlab.com/luk3yx/minetest-formspec_ast.git
synced 2025-10-10 22:43:08 +02:00
Bugfix and documentation update.
This commit is contained in:
parent
0ef995ab5c
commit
c551fc2b8e
@ -31,6 +31,8 @@ A Minetest mod library to make modifying formspecs easier.
|
||||
- `formspec_ast.safe_parse(string_or_tree)`: Similar to `formspec_ast.parse`,
|
||||
however will delete any elements that may crash the client (or any I
|
||||
haven't added to the whitelist).
|
||||
- `formspec_ast.formspec_escape(text)`: The same as `minetest.formspec_escape`,
|
||||
should only be used when formspec_ast is being embedded outside of Minetest.
|
||||
|
||||
## AST
|
||||
|
||||
|
3
init.lua
3
init.lua
@ -37,6 +37,7 @@ if minetest then
|
||||
modpath = minetest.get_modpath('formspec_ast')
|
||||
assert(minetest.get_current_modname() == 'formspec_ast',
|
||||
'This mod must be called formspec_ast!')
|
||||
formspec_ast.formspec_escape = minetest.formspec_escape
|
||||
else
|
||||
-- Probably running outside Minetest.
|
||||
modpath = rawget(_G, 'FORMSPEC_AST_PATH') or '.'
|
||||
@ -67,6 +68,7 @@ else
|
||||
return res
|
||||
end
|
||||
formspec_ast.minetest = minetest
|
||||
formspec_ast.formspec_escape = minetest.formspec_escape
|
||||
end
|
||||
|
||||
formspec_ast.modpath = modpath
|
||||
@ -76,4 +78,3 @@ dofile(modpath .. '/helpers.lua')
|
||||
dofile(modpath .. '/safety.lua')
|
||||
|
||||
formspec_ast.modpath, formspec_ast.minetest = nil, nil
|
||||
formspec_ast.formspec_escape = minetest.formspec_escape
|
||||
|
Loading…
Reference in New Issue
Block a user