Module:Sandbox

local p = {}

p.items = function( f ) local args = f.args or f       if f == mw.getCurrentFrame and args[1] == nil then args = f:getParent.args else f = mw.getCurrentFrame end local text = "" items = split_on_escaped_comma(args[1]) for i, item in pairs(items) do               text = text .. f:callParserFunction('#icon', {"", item = item, size = 16, mod = args.mod}) end return text end

function split_on_escaped_comma(inputstr) local t={} ; i=1 for str in string.gmatch(inputstr, "(?!\[^,]+)") do               t[i] = str i = i + 1 end return t end

return p