Content deleted Content added
fix sort |
optimize, add comments |
||
Line 167:
end
local active_param = {} -- Set of active parameters
for param, _ in pairs (args_t) do
-- loop through all parameters
local tag_match = mw.ustring.match(param, "^tag(%d+)$") -- check for numbered tag
local name_match = mw.ustring.match(param, "^name(%d+)$")▼
if tag_match then
active_param[tonumber(tag_match)] = true -- if there, add number to active parameter set
else
elseif name_match then▼
▲ local name_match = mw.ustring.match(param, "^name(%d+)$") -- else check for numbered name
active_param[tonumber(name_match)] = true -- if there, add number to active parameter set
end
end
end
local param_list = {} -- created sorted list of numbered parameters
for n, _ in pairs(active_param) do
table.insert(param_list, n)
Line 188 ⟶ 190:
local list_t = {}; -- list of formatted native names goes here
for _, n in ipairs(param_list) do -- loop through numbered parameters, in order
table.insert (list_t, table.concat ({
'<li>', -- open the list item
|