Module:Sprite: Difference between revisions

Nowrap the whole damn thing because CSS...
Move nowrap span inside links
Line 86: Line 86:
end
end
local content = '<span class="nowrap">' .. sprite .. text .. '</span>'
if link ~= '' and mw.ustring.lower( link ) ~= 'none' then
if link ~= '' and mw.ustring.lower( link ) ~= 'none' then
if link:find( '//' ) then
if link:find( '//' ) then
-- External link
-- External link
return '<span class="nowrap">[' .. link .. ' ' .. sprite .. text .. ']</span>'
return '[' .. link .. ' ' .. content .. ']'
else
else
-- Internal link
-- Internal link
local linkPrefix = args.linkprefix or default.linkprefix or ''
local linkPrefix = args.linkprefix or default.linkprefix or ''
return '<span class="nowrap">[[' .. linkPrefix .. link .. '|' .. sprite .. text .. ']]</span>'
return '[[' .. linkPrefix .. link .. '|' .. content .. ']]'
end
end
else
else
return '<span class="nowrap">' .. sprite .. text .. '</span>'
return content
end
end
end
end