Module:RedirectTarget
跳到导航
跳到搜索
local getRedirectTarget = function(title) if title == nil then return nil else local target = nil local temp = title repeat target = temp temp = temp.redirectTarget until not temp return target end end return { main = function(frame) local args = frame.args local title = mw.text.trim(args[1] or "") if mw.isSubsting() then local success, target = pcall(getRedirectTarget, mw.title.new(title)) if success and target then return tostring(target) else return title end else return title end end }