Content deleted Content added
put the class value in lower case to match both "Dab" and "dab" etc., and some more comment tweaking |
get the namespace parameter names from Module:Namespace detect automatically in case any new namespaces are added |
||
Line 82:
local nsDetectModule = require('Module:Namespace detect')
local nsDetect = nsDetectModule._main
local getParamMappings = nsDetectModule.getParamMappings
local getPageObject = nsDetectModule.getPageObject
Line 119 ⟶ 120:
end
-- Add custom values passed in from the arguments. These overwrite the defaults.
-- The possible argument names are fetched from [[Module:Namespace detect]] automatically in case new namespaces are added.
for namespace in pairs(cfg.pagetypes) do▼
local mappings = getParamMappings()
local ndArg = checkPagetypeInput(namespace, args[namespace])▼
if ndArg == false then▼
for _, paramName in ipairs(paramNames) do
-- If any arguments are false, convert them to nil to protect against breakage by future changes▼
-- to [[Module:Namespace detect]].▼
▲ if ndArg == false then
ndArgs[namespace] = nil▼
▲ -- If any arguments are false, convert them to nil to protect against breakage by future changes
elseif ndArg then▼
▲ -- to [[Module:Namespace detect]].
ndArgs[namespace] = ndArg▼
▲ elseif ndArg then
end
end
end
--
if ndArgs.main then
local class = args[1]
|