Module:Redirect template: Difference between revisions
From Roses, Tulips, & Liberty
Content added Content deleted
(Undid revision 631146884 by Petr Matas (talk): This doesn't work at all, and nothing like it can work) |
(Grandparent parameters cannot be obtained, so get the passed parameter) |
||
Line 44: | Line 44: | ||
local namespace = mw.title.getCurrentTitle().namespace |
local namespace = mw.title.getCurrentTitle().namespace |
||
local otherCategory = args['other category'] and (args.category or string.format('[[Category:%s]]', args['other category'])) |
local otherCategory = args['other category'] and (args.category or string.format('[[Category:%s]]', args['other category'])) |
||
local embedPossible = (frame.args.embed or frame:getParent().args.embed or 'yes') == '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 |
--- 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 beCompatibleWithBug12974 = args.info and (args.info:find('^[:;#*]', 1) == 1 or args.info:find('{|', 1, true) == 1) and '\n' or ' ' |
||
local retval = string.format('*%sThis is a redirect%s%s.%s%s\n', |
local retval = string.format('*%sThis is a redirect%s%s.%s%s\n', |
||
args.name and getPrettyName(args) or '', |
embedPossible and args.name and getPrettyName(args) or '', |
||
args.from and (' from ' .. args.from) or '', |
args.from and (' from ' .. args.from) or '', |
||
args.to and (' to ' .. args.to) or '', |
args.to and (' to ' .. args.to) or '', |