Anonymous user
Module:Redirect template: Difference between revisions
Undid revision 876443655 by MSGJ (talk) undoing this change as it seems to break the formatting of the rcat text if multiple rcat templates are used and contains wiki text with at least one example of multiple consecutive asterisks/bullets (see Template:Redirect template/testcases#Test The Honeycombs (album)), making the second line appear too far out and following rcat templates with uncontrollable indenting - User:SD0001
(Undid revision 876443655 by MSGJ (talk) undoing this change as it seems to break the formatting of the rcat text if multiple rcat templates are used and contains wiki text with at least one example of multiple consecutive asterisks/bullets (see Template:Redirect template/testcases#Test The Honeycombs (album)), making the second line appear too far out and following rcat templates with uncontrollable indenting - User:SD0001) |
|||
Line 22:
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' and key ~= 'category' and key ~= 'embed' then
return nil
end
Line 32:
for k in pairs(namespaceCategories) do
if args[k .. ' category'] then
return
end
end
return
end
function p.
end
local namespace = mw.title.getCurrentTitle().namespace
local embedPossible = args.embed == nil or args.embed == 'yes'
--- 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
embedPossible and args.
args.from and (' from ' .. args.from) or '',
args.to and (' to ' .. args.to) or '',
Line 53 ⟶ 56:
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
retval = retval .. otherCategory
▲ content = content .. string.format('[[Category:%s]]', args['other category'])
else
end
end
end
return retval
end
function p.main(frame)
▲ if namespace == 0 then
local retval = p.core(frame, args)
if yesno(args.printworthy) == true then▼
if mw.title.getCurrentTitle().namespace == 0 then
return content .. '[[Category:Printworthy redirects]]'▼
return
end
end
return
end
|