Replace variable parsing in guide with pattern matching

This commit is contained in:
2025-12-04 21:42:44 +01:00
parent 6c93528d13
commit eb546fd07b

View File

@@ -1193,9 +1193,10 @@ local function preprocessHypertext(content,vars)
return S(sourceString) return S(sourceString)
end) end)
for key,value in pairs(vars) do -- Replace all sequences which should be treated as variables with values provided in vars
content=string.gsub(content,string.format("{{%s}}",key),value) content=string.gsub(content,"{{([^{}]+)}}",function(var)
end return vars[var] or "nil"
end)
return content return content
end end