Module:Protection banner/sandbox: Difference between revisions

Content deleted Content added
use the config sandbox
Jackmcbarn (talk | contribs)
makeCategoryLink should return nil rather than '' when there's no cat, to avoid unnecessary empty entries in the table, and it's never called without a sort key
Line 20:
 
local function makeCategoryLink(cat, sort)
elseifif cat then
local nsText = mw.site.namespaces[14].name
if cat and sort then
return string.format(
'[[%s:%s|%s]]',
local nsText = mw.site.namespaces[14].name,
nsText,
cat,
sort
)
elseif cat then
return string.format(
'[[%s:%s]]',
nsText,
cat
)
else
return ''
end
end