Replace variable parsing in guide with pattern matching
This commit is contained in:
parent
6c93528d13
commit
eb546fd07b
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user