Changes
code cleanup by User:SD0001. See Module:Redirect template/sandbox for edit summary of erach change.
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' and key ~= 'category' and key ~= 'embed' then
return nil
end
for k in pairs(namespaceCategories) do
if args[k .. ' category'] then
return string.format("'''<b>[[:Category:%s|%s]]</b>:" .. , args[k .. ' category'] .. "|" .. , args.name .. "]]''': ")
end
end
return string.format("'''<b>%s</b>" .. , args.name .. "''': ")
end
function p.coremain(frame, args) if not args then local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:Redirect template/core', valueFunc = valueFunc}) end
local namespace = mw.title.getCurrentTitle().namespace
--- XXX: this is a HORRIBLE HACK. kill it with fire as soon as https://bugzilla.wikimedia.org/show_bug.cgi?id=12974 is fixed
local beCompatibleWithBug12974 = args.info and (args.info:find('^[:;#*]', 1) == 1 or args.info:find('{|', 1, true) == 1) and '\n' or ' '
local retval content = string.format('*<ul class="rcat %s"><li>%sThis is a redirect%s%s.%s%s</li></ul>', args.class or '', embedPossible and args.name and getPrettyName(args) or '',
args.from and (' from ' .. args.from) or '',
args.to and (' to ' .. args.to) or '',
args.info or ''
)
for k,v in pairs(namespaceCategories) do
if args[k .. ' category'] then
if type(v[1]) == 'function' and v[1](namespace) or v[1] == namespace then
elseif args['other category'] then
else
end
end
end
end
end
return retvalcontent
end
return p