Jump to content

Module:Article list and Module:Article list/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
Content deleted Content added
Replace Module:No globals with require( "strict" )
 
use require('strict') instead of require('Module:No globals')
 
Line 1: Line 1:
local p = {};
require('strict')
require('strict')

local p = {};


local function makelink(link)
local function makelink(link)
Line 91: Line 90:
end
end
end
end
local output = '<ul>'..table.concat(links2)
local output = '<ul>'..table.concat(links2)..'</ul>'
if mw.title.getCurrentTitle():inNamespace(10) then
if mw.title.getCurrentTitle():inNamespace(10) then
output = output..notes
output = output..notes
end
end
return output ..'</ul>'
return output
end
end


Line 102: Line 101:
local pargs = frame:getParent().args
local pargs = frame:getParent().args
local input = args[1] or pargs[1]
local input = args[1] or pargs[1]
local prefix = args.prefix or pargs.prefix
if prefix == nil then
prefix = "Article list|"
end
if input == nil then
if input == nil then
return nil
return nil
Line 123: Line 118:
end
end
end
end
return "{{" .. prefix .. table.concat(qidlist,", ").."}}"
return "{{Article list|"..table.concat(qidlist,", ").."}}"
end
end