Difference between revisions of "Module:Icon"

Jump to navigation Jump to search
276 bytes added ,  16:00, 23 October 2021
no edit summary
Line 3: Line 3:


require('Module:Icon/data')
require('Module:Icon/data')
local function trim(object)
if string.sub(object, 1, 2) == ' ' then
object = string.sub(object, 2)
end
if string.sub(object, string.len(object)-1) == ' ' then
object = string.sub(object, 1, string.len(object) - 1)
end
return object
end


local function _requirements(resource, value, link, text)
local function _requirements(resource, value, link, text)
resource = trim(object)
if iconList[string.lower(resource)] ~= nil then
if iconList[string.lower(resource)] ~= nil then
result = '[[file:' .. iconList[resource]['file'] .. '|16px|link='
result = '[[file:' .. iconList[resource]['file'] .. '|16px|link='

Navigation menu