diff --git a/mods/display_modpack/font_api/fontform.lua b/mods/display_modpack/font_api/fontform.lua index b7e6724d..9768788d 100644 --- a/mods/display_modpack/font_api/fontform.lua +++ b/mods/display_modpack/font_api/fontform.lua @@ -51,15 +51,9 @@ local function show_node_formspec(playername, pos) fs = fs:gsub("context", nodemeta) -- Change all ${} to their corresponding metadata values - local s, e - repeat - s, e = fs:find('%${.*}') - if s and e then - fs = fs:sub(1, s-1).. - minetest.formspec_escape(meta:get_string(fs:sub(s+2,e-1))).. - fs:sub(e+1) - end - until s == nil + fs = fs:gsub("([^\\])${(.-)}", function(prefix, key) + return prefix .. minetest.formspec_escape(meta:get_string(key)) + end) local context = get_context(playername) context.node_pos = pos