Module:WikiProject banner/sandbox: Difference between revisions

Content deleted Content added
m Include ']' in special_chars{} to prevent unmatched close-bracket error (Talk:1993 in Lithuanian football)
No edit summary
Line 57:
end
 
local importance_mask = function(raw_importance, class, scale, banner_name)
---------------------------
-- Importance mask --------
---------------------------
local importance
local importance_mask = function(raw_importance, class, scale, banner_name)
if scale=='inline' then -- pass importance without change
local importance
importance = raw_importance
if scale=='inline' then -- pass importance without change
elseif scale=='subpage' then
importance = raw_importance
local custom_mask = banner_name:subPageTitle('importance')
elseif scale=='subpage' then
if custom_mask.exists and #custom_mask:getContent()>1 then -- pass to custom importance mask
local custom_mask = banner_name:subPageTitle('importance')
importance = mw.text.trim(frame:expandTemplate{
if custom_mask.exists and #custom_mask:getContent()>1 then -- pass to custom importance mask
title = custom_mask.prefixedText,
importance = mw.text.trim(frame:expandTemplate{
args = {importance=raw_importance or '¬', class=class}
title = custom_mask.prefixedText,
})
args = {importance=raw_importance or '¬', class=class}
})
end
else
importance = frame:expandTemplate{
title = 'Template:Importance mask',
args = {raw_importance or '¬', class=class}}
end
elseif raw_importance then-- standard importance scale
if importance=='¬' then
local mask = {top = 'Top', high = 'High', mid = 'Mid', low = 'Low', na = 'NA', no = 'NA'}
importance = nil
if mask[raw_importance:lower()] then
importance = mask[raw_importance:lower()]
else
importance = frame:expandTemplate{'Unknown'
end
end
return importance
return importance = nil
end
 
Line 103:
local ns = title.namespace
class = class:match('^%s*(.-)%s*$'):lower()
 
if pagetype=='redirect' or pagetype=='soft redirect' then
out = resolveFQSgrade('redirect')