Module:WikiProject banner/sandbox: Difference between revisions

Content deleted Content added
fix?
much simpler
Line 137:
local parameter_check = ''
if invoke and banner_name.exists then
local pargsparent_args = args_module.getArgs(frame, {parentOnly = true})
local template_code = banner_name:getContent()
local parameters = {}
for variantparameter in string.gmatch(codetemplate_code, '{{{([^|]+)') do
local check_param = function(parameter)
table.insert(parameters, variant)
local code = string.match(template_code, parameter .. '%s*=%s*({{{[^}]*)')-- gets code relating to the parameter until the first '}' is encountered
if code then
for variant in string.gmatch(code, '{{{([^|]+)') do
table.insert(parameters, variant)
end
end
end
for _, parameter in ipairs(cfg.template_page.parameters.passthrough) do
check_param(parameter)
end
for _, k in ipairs(task_forces) do
check_param('tf ' .. k)
check_param('tf ' .. k .. ' importance')
end
for _, k in ipairs(notes) do
check_param('note ' .. k)
end
parameters.preview = string.format(
Line 165 ⟶ 150:
parameters.unknown = mw.title.new(unknown_category).exists and '[[' .. unknown_category .. '|_VALUE_]]' or ''
if demo then parameters.unknown = '' end
parameter_check = require('Module:Check for unknown parameters')._check(parameters, pargsparent_args)
end
---------------------------