mirror of
https://github.com/TangentFoxy/lume.git
synced 2025-07-28 11:02:20 +00:00
Fixed lume.format() where missing keys were not ignored
This commit is contained in:
2
lume.lua
2
lume.lua
@@ -231,7 +231,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function lume.format(str, vars)
|
function lume.format(str, vars)
|
||||||
local f = function(x) return tostring(vars[x]) or "{" .. x .. "}" end
|
local f = function(x) return tostring(vars[x] or "{" .. x .. "}") end
|
||||||
return (str:gsub("{(.-)}", f))
|
return (str:gsub("{(.-)}", f))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user