Module:Redirect template: Difference between revisions

work around MediaWiki's bug 12974
(fix bug reported on VPT)
(work around MediaWiki's bug 12974)
Line 44:
local namespace = mw.title.getCurrentTitle().namespace
local otherCategory = args['other category'] and (args.category or string.format('[[Category:%s]]', args['other category']))
local retval = string.format('*%sThis is a redirect%s%s.\n%s\n',
--- 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 = string.format('*%sThis is a redirect%s%s.\n%s%s\n',
args.name and getPrettyName(args) or '',
args.from and (' from ' .. args.from) or '',
args.to and (' to ' .. args.to) or '',
args.info and beCompatibleWithBug12974 or '',
args.info or ''
)
Anonymous user