Jump to content

Module:Documentation: Difference between revisions

replace another argument name with a hardcoded value
m>Mr. Stradivarius
(hardcode "off" in "link box=off" as well, for the benefit of other modules/templates)
m>Mr. Stradivarius
(replace another argument name with a hardcoded value)
Line 104: Line 104:
local function makeInvokeFunc(funcName)
local function makeInvokeFunc(funcName)
return function (frame)
return function (frame)
local headingArg = message('headingArg', 'string')
local args = getArgs(frame, {
local args = getArgs(frame, {
valueFunc = function (key, value)
valueFunc = function (key, value)
if type(value) == 'string' then
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == headingArg or value ~= '' then
if key == 'heading' or value ~= '' then
return value
return value
else
else
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.