Module:Infobox: Difference between revisions

From Vintage Story Wiki
m
no edit summary
m (Added image extension detection)
mNo edit summary
Line 8: Line 8:
subtitle = '<span style="font-size:15px"><b><i>"' .. args.subtitle .. '"</i></b></span>'
subtitle = '<span style="font-size:15px"><b><i>"' .. args.subtitle .. '"</i></b></span>'
end
end
local size = args.imagesize or '180px'
local imageSize = args.imagesize or '180px'
local imageString
local imageString
local images = {}
local images = {}
Line 27: Line 27:
elseif args.image then
elseif args.image then
local image = args.image
local image = args.image
if image:match('(.*).png') or image:match('(.*).jpg') or image:match('(.*).svg') then imageString = '[[File:' .. image .. '|180px]]'
if image:match('(.*).png') or image:match('(.*).jpg') or image:match('(.*).svg') then imageString = '[[File:' .. image .. '|' .. imageSize  .. ']]'
else
else
imageString = '[[File:' .. image .. '.png|180px]]'
imageString = '[[File:' .. image .. '.png|' .. imageSize .. ']]'
end
end
else
else
Confirmedusers, Interface administrators
1,131

edits