Difference between revisions of "Module:Extension"

277 bytes added ,  15:27, 8 June 2020
manifest version 1 uses a special _prefix key in the config object, not a config_prefix key in the root object, to set the config key prefix
>Pppery
(Support custom prefixes)
>Tacsipacsi
(manifest version 1 uses a special _prefix key in the config object, not a config_prefix key in the root object, to set the config key prefix)
Line 340: Line 340:
return ""
return ""
end
end
local prefix = data.config_prefix or "wg"
local prefix = "wg"
local skip_prefix = false
if data.manifest_version and data.manifest_version >= 2 then
if data.config_prefix then
prefix = data.config_prefix
end
else
if config._prefix then
prefix = config._prefix
skip_prefix = true
end
end
local out = ""
local out = ""
for key, _ in pairs(config) do
for key, _ in pairs(config) do
out = out .. "* $" .. prefix .. key .. "\n"
if key ~= '_prefix' or not skip_prefix then
out = out .. "* $" .. prefix .. key .. "\n"
end
end
end
return out
return out
Anonymous user