Module:Crafting: Difference between revisions

m
no edit summary
m (How about a regular match)
mNo edit summary
 
(7 intermediate revisions by the same user not shown)
Line 110: Line 110:
end
end


if string.match(args['count'],'%?') or string.match(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 = "?"
if count ~= 1 then
else
local count = tonumber(args['count']) or tonumber(args['Count']) or 1
end
if count == "?" or count ~= 1 then
local countSpan = parentDiv:tag("span"):wikitext(count)
local countSpan = parentDiv:tag("span"):wikitext(count)
countSpan:addClass("invslot-stacksize")
countSpan:addClass("invslot-stacksize")
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