Module:Class mask/sandbox: Difference between revisions

Content deleted Content added
rv to prev
simp
Line 1:
-- This module implements [[Template:Class mask]].
 
local p = {}
 
Line 9 ⟶ 7:
}
end
end
 
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
 
Line 70 ⟶ 64:
local function getGrade(args, title)
local grade = args[1]
returngrade s= grade and grade:match('^%s*(.-)%s*$'):lower()
-- We use string.lower here as it's faster than mw.ustring.lower and none
-- of the standard grades have non-Ascii characters.
grade = grade and trim(grade):lower()
 
local ret
 
Line 81 ⟶ 72:
 
-- Ucfirst
-- We put these near the start as they are probably the most common grades
-- on the site. The other grades are also roughly in order of prevalence.
elseif grade == 'start' or grade == 'stub' or grade == 'list' then
if args[grade] ~= 'no' then