8,278
edits
No edit summary |
No edit summary Tag: Reverted |
||
Line 15: | Line 15: | ||
align = 'text-top' | align = 'text-top' | ||
} | } | ||
local id = mw.text.trim( tostring( args[1] or '' ) ) | local id = mw.text.trim( tostring( args[1] or '' ) ) | ||
if not args.keepcase then | if not args.keepcase then | ||
id = mw.ustring.lower( id ):gsub( '[%s%+]', '-' ) | id = mw.ustring.lower( id ):gsub( '[%s%+]', '-' ) | ||
end | |||
local link = ( args.link or '' ) | |||
if mw.ustring.lower( link ) == 'none' then | |||
end | link = '' | ||
elseif link ~= '' then | |||
local linkPrefix = ( not link:find( '//' ) and args.linkprefix ) or '' | |||
link = linkPrefix .. link | |||
end | |||
-- -- Edited to turn regular links into vanilla: prefixes and to turn parallel: prefixes into regular links | |||
-- local link = ( args.link or '' ) | -- local link = ( args.link or '' ) | ||
-- if mw.ustring.lower( link ) == 'none' then | -- if mw.ustring.lower( link ) == 'none' then | ||
Line 36: | Line 35: | ||
-- elseif link ~= '' then | -- elseif link ~= '' then | ||
-- local linkPrefix = ( not link:find( '//' ) and args.linkprefix ) or '' | -- local linkPrefix = ( not link:find( '//' ) and args.linkprefix ) or '' | ||
-- if linkprefix == '' then -- <- these are the added bits here | |||
-- linkprefix = 'vanilla:' | |||
-- elseif linkprefix == 'parallel:' then | |||
-- linkprefix = '' | |||
-- end | |||
-- link = linkPrefix .. link | -- link = linkPrefix .. link | ||
-- | -- end | ||
local scale = args.scale or default.scale | local scale = args.scale or default.scale | ||
Line 70: | Line 60: | ||
name = 'Invicon' | name = 'Invicon' | ||
end | end | ||
local file = name .. ' ' .. id .. '.png' | |||
local altText = file .. ': Sprite image for ' .. id .. ' in Minecraft' | local altText = file .. ': Sprite image for ' .. id .. ' in Minecraft' | ||
if link ~= '' then | if link ~= '' then | ||
Line 107: | Line 96: | ||
spriteText = '[' .. link .. ' ' .. tostring( spriteText ) .. ']' | spriteText = '[' .. link .. ' ' .. tostring( spriteText ) .. ']' | ||
else | else | ||
spriteText = '[[' .. link .. '|' .. tostring( spriteText ) .. ']]' | |||
end | end | ||
end | end |