Module:Crafting: Difference between revisions

m
no edit summary
m (Does this make ? count work)
mNo edit summary
 
(11 intermediate revisions by the same user not shown)
Line 110: Line 110:
end
end


if args['count'] == '?' or args['Count'] == '?' then
local count = tonumber(args['count']) or tonumber(args['Count']) or string.match(tostring(args['count']),'%?') or string.match(tostring(args['Count']),'%?') or 1
local count = "?"
else
local count = tonumber(args['count']) or tonumber(args['Count']) or 1
end
if count ~= 1 then
if count ~= 1 then
local countSpan = parentDiv:tag("span"):wikitext(count)
local countSpan = parentDiv:tag("span"):wikitext(count)
Line 125: Line 121:
spriteDiv:addClass("enchanted")
spriteDiv:addClass("enchanted")
end
end


local link = args['link'] or args['Link']
local link = args['link'] or args['Link']
Line 138: Line 133:


parentDiv:node(spriteDiv)
parentDiv:node(spriteDiv)
if link and #link ~= 0 then
if link and #link ~= 0 then
if link:sub( 1,2 ) == '[[' then
if link:sub( 1,2 ) == '[[' then
Bureaucrats, Check users, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, Widget editors
1,637

edits