Module:Redirect template: Difference between revisions
Pull in sandbox changes requested by User:MJL@Template talk:Redirect template#Template-protected edit request on 12 December 2021 |
Richardpruen (talk | contribs) m 1 revision imported: template update |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
require(' | require('strict') | ||
local p = {} | local p = {} | ||
Line 16: | Line 16: | ||
category = { 14, '[[wp:categorization|category]]' }, | category = { 14, '[[wp:categorization|category]]' }, | ||
user = { 2, '[[wp:user pages|user]]' }, | user = { 2, '[[wp:user pages|user]]' }, | ||
draft = { 118, '[[wp:drafts|draft]]' }, | |||
} | } | ||
Line 42: | Line 43: | ||
local namespace = mw.title.getCurrentTitle().namespace | 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 | --- XXX: this is a HORRIBLE HACK. kill it with fire as soon as https://phabricator.wikimedia.org/T14974 is fixed | ||
local | --- [[phab:T14974]] was previously known as [[bugzilla:12974]] https://bugzilla.wikimedia.org/show_bug.cgi?id=12974 | ||
local beCompatibleWithBug14974 = args.info and (args.info:find('^[:;#*]', 1) == 1 or args.info:find('{|', 1, true) == 1) and '\n' or ' ' | |||
local content = string.format('\n<div class="rcat %s">\n*%sThis is a redirect%s%s.%s%s\n</div>', | local content = string.format('\n<div class="rcat %s">\n*%sThis is a redirect%s%s.%s%s\n</div>', | ||
Line 50: | Line 52: | ||
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 '', | ||
args.info and | args.info and beCompatibleWithBug14974 or '', | ||
args.info or '' | args.info or '' | ||
) | ) |