Module:Crafting: Difference between revisions

Better inlining that actually works
(Add inline support by `{{Stack|...|inline = True}}`)
(Better inlining that actually works)
Line 52: Line 52:


local tagtype
local tagtype
local inline = args['inline'] or args['Inline']


if inline then
local sprite = require([[Module:Sprite]])
tagtype = "span"
:new("inventory")
:setItem(mw.text.trim(args[1] or ""))
 
if args['small'] or args['Small'] then
sprite:SetSize(16)
end
 
local spriteDiv = sprite:GenerateHTML()
if args['inline'] or args['Inline'] then
 
spriteDiv:css("display","inline-block")
spriteDiv:css("vertical-align","middle")
end
end


local spriteDiv = require([[Module:Sprite]])
:new("inventory")
:setItem(mw.text.trim(args[1] or ""))
:GenerateHTML(nil, tagtype)




Bureaucrats, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, translator, Widget editors
154

edits