切换搜索
搜索
切换菜单
notifications
切换个人菜单
查看“模块:Redirect-multi”的源代码
来自决策链云智库
更多操作
←
模块:Redirect-multi
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local mRedirectHatnote = require('Module:Redirect hatnote') local mArguments = require('Module:Arguments') local mHatnote = require('Module:Hatnote') local p = {} function p.redirectMulti (frame) local args = mArguments.getArgs(frame) --Get maxArg manually because getArgs and table.maxn aren't friends local maxArg = 0 for k, v in pairs(args) do if type(k) == 'number' and k > maxArg then maxArg = k end end --Get number of redirects then remove it from the args table local numRedirects = tonumber(args[1]) or 1 --Manual downshift of arguments; not using table.remove because getArgs is --gnarly and it's not a sequence anyway for i = 2, maxArg + 1 do args[i - 1] = args[i] end --if no arguments past redirects exist, add in a default set if maxArg - 2 <= numRedirects then for i = 1, numRedirects do args[numRedirects + (2 * i)] = args[i] and mHatnote.disambiguate(args[i]) --this does add in an "and" after the last item, but it's ignored args[numRedirects + (2 * i) + 1] = 'and' end end local options = {selfref = args.selfref} return mRedirectHatnote._redirect(args, numRedirects, options) end return p
本页使用的模板:
模板:Sandbox other
(
查看源代码
)
模板:Tl
(
查看源代码
)
模块:Redirect-multi/doc
(
查看源代码
)
模块:String
(
查看源代码
)
返回
模块:Redirect-multi
。