Module:Icon: Difference between revisions
NeonWabbit (talk | contribs) Created page with "-- This module implements Template:Icon. require("strict") local yesNo = require("Module:Yesno") local getArgs = require("Module:Arguments").getArgs local getPlain = nil local p = {} -- Determine whether we're being called from a sandbox local sandbox = mw.getCurrentFrame():getTitle():find('sandbox', 1, true) and '/sandbox' or '' -- Implements Template:Icon -- Returns the icon image corresponding to a string (like 'B') function p._main(args, data) local data..." |
NeonWabbit (talk | contribs) No edit summary |
||
| Line 54: | Line 54: | ||
-- if display is link, just use standard wlink | -- if display is link, just use standard wlink | ||
if link == display then | if link == display then | ||
return icon..' | return '<span class="nowrap">'..icon..' </span>[['..link..']]' | ||
end | end | ||
return icon..' | return '<span class="nowrap">'..icon..' </span>[['..link..'|'..display..']]' | ||
end | end | ||
| Line 68: | Line 68: | ||
return p._link(args) | return p._link(args) | ||
end | end | ||
p[''] = function (frame) return p._main(frame.args) end | |||
return p | return p | ||