EinsDreiDreiSieben/mods/futil/minetest/texture.lua

9 lines
310 B
Lua

-- https://github.com/minetest/minetest/blob/9fc018ded10225589d2559d24a5db739e891fb31/doc/lua_api.txt#L453-L462
function futil.escape_texture(texturestring)
-- store in a variable so we don't return both rvs of gsub
local v = texturestring:gsub("[%^:]", {
["^"] = "\\^",
[":"] = "\\:",
})
return v
end