Module:Redirect template: Difference between revisions

restore the new version, with a fix for blanks becoming nils
(Reverted good faith edits by Jackmcbarn: The result of this would always be true, because Module:Arguments changes empty arguments to nil. That is not what we want. (TW))
(restore the new version, with a fix for blanks becoming nils)
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 44:
local namespace = mw.title.getCurrentTitle().namespace
local otherCategory = args['other category'] and (args.category or string.format('[[Category:%s]]', args['other category']))
local embedPossible = (frame.args.embed == nil 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
Anonymous user