Module:Filestrip

-- -- 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]) local param = frame.args[2] local iterator = file:gmatch('%') local count = 0 local entry = '' local entries = {} for file in iterator do       count = count + 1 entries[count] = file:sub(8, -9) end for i, v in ipairs(entries) do       if count == 1 then entry = v .. ' | ' .. param else entry = entry .. '\n' .. v .. ' | ' .. param .. ' (' .. i .. ')' end end return entry end

return p