Module:Args

-- Merges the arguments passed by `#invoke` and the template call (with the former taking precedence), trimming leading and trailing whitespaces. function getCleanArgs local args_copy = {} local function cleanArg(arg) arg = mw.text.trim(arg) if arg == "" then return nil end return arg end local args_template = mw.getCurrentFrame:getParent.args for k, v in pairs(args_template) do args_copy[k] = cleanArg(v) end

local args_invoke = mw.getCurrentFrame.args for k, v in pairs(args_invoke) do args_copy[k] = cleanArg(v) end

return args_copy end

return { getCleanArgs = getCleanArgs }