Module:Section link: Difference between revisions

    m>Mr. Stradivarius
    (actually, just make the sections optional)
    m>Mr. Stradivarius
    (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
    })
    })