Difference between revisions of "Module:Icon"

Jump to navigation Jump to search
2 bytes added ,  17:07, 14 February 2022
no edit summary
Line 58: Line 58:


function p.iconList(frame)
function p.iconList(frame)
list = string.gsub(string.gsub(frame.args[1], '%[%[', ''), '%]%]', '')
if string.match(string.lower(frame.args[1]), '%[%[file:') ~= nil then
-- list = string.gsub(string.gsub(list, '%{%{item%|', ''), '%}%}', '')
return '[[Category:Material List with Embedded Templates]]'
-- list = string.gsub(list, '<br%s>', ';')
else
-- list = string.gsub(list, '%|', '-')
list = string.gsub(string.gsub(frame.args[1], '%[%[', ''), '%]%]', '')
mw.log(list)
mw.log(list)
list = mw.text.split(list, ';')
list = mw.text.split(list, ';')
result = ''
result = ''
for k, v in ipairs(list) do
for k, v in ipairs(list) do
vs = mw.text.split(v, '-')
vs = mw.text.split(v, '-')
result = result .. _requirements(vs[1], vs[2], nil, frame.args['text'])
result = result .. _requirements(vs[1], vs[2], nil, frame.args['text'])
if k ~= table.getn(list) then
if k ~= table.getn(list) then
result = result .. '<br />'
result = result .. '<br />'
end
end
end
end
end

Navigation menu