Module:lua banner: Difference between revisions

no edit summary
No edit summary
No edit summary
 
Line 35: Line 35:
else
else
local moduleLinks = {}
local moduleLinks = {}
local withns
for i, module in ipairs(modules) do
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', 'Module:' .. module)
withns = mw.ustring.match(module, "^[mM]odule:")
moduleLinks[i] = string.format('[[:%s]]', (withns and '' or 'Module:') .. module)
local maybeSandbox = mw.title.new(module .. '/sandbox')
local maybeSandbox = mw.title.new(module .. '/sandbox')
if maybeSandbox.exists then
if maybeSandbox.exists then