1,124
edits
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=' |