Difference between revisions of "Module:Icon"

Jump to navigation Jump to search
No change in size ,  16:14, 23 October 2021
no edit summary
Line 5: Line 5:


local function trim(object)
local function trim(object)
if string.sub(object, 1, 2) == ' ' then  
if string.sub(object, 1, 1) == ' ' then  
object = string.sub(object, 2)
object = string.sub(object, 2)
end
end
if string.sub(object, string.len(object)-1) == ' ' then
if string.sub(object, string.len(object)) == ' ' then
object = string.sub(object, 1, string.len(object) - 1)
object = string.sub(object, 1, string.len(object) - 1)
end
end
Line 17: Line 17:


local function _requirements(resource, value, link, text)
local function _requirements(resource, value, link, text)
resource = trim(object)
resource = trim(resource)
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