Kirby Wiki
Advertisement

Documentation for this module may be created at Module:Filestrip/doc

-- <nowiki>
-- Lua module that changes file links in infoboxes
-- to proper infobox gallery items
local p = {}

function p.strip(frame)
    local file = mw.text.trim(frame.args[1] or '')
    local param = frame.args[2] or ''
    file = file:gsub('|%d+x?%d*px', '')
        :gsub('|alt=.-([|%]])', '%1')
        :gsub('|link=.-([|%]])', '%1')
        :gsub('%[%[[fF]ile:(.-[^%|%]])%]%]', '%1\n')
        :gsub('\n\n', '\n')
    return file
end

return p
Advertisement