Module:Section link: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(actually, just make the sections optional)
(allow blank first parameters, as the template also does this)
Line 72: Line 72:
function p.main(frame)
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Section link'
wrappers = 'Template:Section link',
valueFunc = function (key, value)
value = value:match('^%s*(.-)%s*$') -- Trim whitespace
-- Allow blank first parameters, as the wikitext template does this.
if value ~= '' or key == 1 then
return value
end
end
})
})