變更
無編輯摘要
local pl={}
local getArgs
local SPLIT="、"
local LASTSPLIT="和"
local LIMIT=20
pl.main=function(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
local args = getArgs(frame, {parentFirst=true})
local curPage_obj=mw.title.getCurrentTitle()
args["nspace"]=args["nspace"] or curPage_obj.nsText
return pl._main(args)
end
pl._main=function(args)
local delim=args["delim"] or ""
local edelim=args["edelim"] or delim
local NS=args["nspace"]
--mw.log(delim)
--mw.log(edelim)
--mw.log(NS)
local out={}
for i=1,LIMIT do
local curVal,nextVal=args[i],args[i+1]
if i~=1 then table.insert(out,(nextVal==nil and LASTSPLIT) or SPLIT) end
if curVal~=nil then table.insert(out,mw.ustring.format("%s[[:%s%s]]%s",delim,((NS=="" and "") or (NS..":")),curVal,edelim)) end
if nextVal==nil then break end
end
return table.concat(out,"")
end
return pl
local getArgs
local SPLIT="、"
local LASTSPLIT="和"
local LIMIT=20
pl.main=function(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
local args = getArgs(frame, {parentFirst=true})
local curPage_obj=mw.title.getCurrentTitle()
args["nspace"]=args["nspace"] or curPage_obj.nsText
return pl._main(args)
end
pl._main=function(args)
local delim=args["delim"] or ""
local edelim=args["edelim"] or delim
local NS=args["nspace"]
--mw.log(delim)
--mw.log(edelim)
--mw.log(NS)
local out={}
for i=1,LIMIT do
local curVal,nextVal=args[i],args[i+1]
if i~=1 then table.insert(out,(nextVal==nil and LASTSPLIT) or SPLIT) end
if curVal~=nil then table.insert(out,mw.ustring.format("%s[[:%s%s]]%s",delim,((NS=="" and "") or (NS..":")),curVal,edelim)) end
if nextVal==nil then break end
end
return table.concat(out,"")
end
return pl