Module:Infobox: Difference between revisions
From Vintage Story Wiki
m (Added image extension detection) |
m (Added image extension detection) |
||
Line 26: | Line 26: | ||
end | end | ||
elseif args.image then | elseif args.image then | ||
imageString = '[[File:' .. | local image = args.image | ||
if image:match('(.*).png') or image:match('(.*).jpg') or image:match('(.*).svg') then imageString = '[[File:' .. image .. '|180px]]' | |||
else | |||
imageString = '[[File:' .. image .. '.png|180px]]' | |||
end | |||
else | else | ||
imageString = '' | imageString = '' |