Module:RoleInfobox: Difference between revisions
Content deleted Content added
m Added trimTable |
m Updated MainImage width |
||
| (3 intermediate revisions by the same user not shown) | |||
Line 1:
local Infobox = {}
local HF = require('Module:HF')
output = {}▼
output[i] = HF.trim(value)▼
end▼
return output▼
end▼
function Infobox.MainImage( field, vars )
local output = field.Value
if not HF.isempty(output) then
output = '[[File:' .. output .. '|
return output
end
Line 15 ⟶ 23:
local ships = HF.explode(';', field.Value)
ships = Infobox.trimTable(ships)
table.sort(ships)
Line 35 ⟶ 43:
local upgrades = HF.explode(';', field.Value)
upgrades = Infobox.trimTable(upgrades)
table.sort(upgrades)
Line 48 ⟶ 56:
return output
end
▲end
▲function Infobox.trimTable ( table )
▲ output = {}
▲ for i, value in ipairs(table) do
▲ output[i] = HF.trim(value)
▲ end
▲ return output
end
| |||