forked from mrkubax10/industrialtest
Replace variable parsing in guide with pattern matching
This commit is contained in:
@@ -1193,9 +1193,10 @@ local function preprocessHypertext(content,vars)
|
||||
return S(sourceString)
|
||||
end)
|
||||
|
||||
for key,value in pairs(vars) do
|
||||
content=string.gsub(content,string.format("{{%s}}",key),value)
|
||||
end
|
||||
-- Replace all sequences which should be treated as variables with values provided in vars
|
||||
content=string.gsub(content,"{{([^{}]+)}}",function(var)
|
||||
return vars[var] or "nil"
|
||||
end)
|
||||
|
||||
return content
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user