Module:Fixes

local p = {} p.fixes = function( f ) local args = f:getParent.args local project = args.project or 'MC' local argLen = 0 for i in ipairs( args ) do		argLen = i	end local sections = {} local headers = {} local section = {} local issues = 0 local index = {} local i = 1 while i < argLen do		local this = args[i] if this:match( '^;' ) then if #section > 0 then table.insert( sections, section ) section = {} end headers[#sections + 1] = this else local issue = tonumber( this:match( '%d+' ) ) if issue then table.insert( section, issue ) issues = issues + 1 index[issue] = i			end i = i + 1 end i = i + 1 end if #section > 0 then table.insert( sections, section ) end local list = {} for i, section in ipairs( sections ) do		local header = mw.text.trim( headers[i] or '' ) if header ~= '' then table.insert( list, header ) end table.sort( section ) for _, issue in ipairs( section ) do			local title = mw.text.trim( args[index[issue] + 1] or '' ) table.insert( list, '* ' .. project:upper .. '-' .. issue .. ' – ' .. title ) end end local trackerQuery = {} local makeQuery = function( query, arg ) if arg and arg ~= '' then table.insert( trackerQuery, query .. ' in ("Minecraft ' .. arg:gsub( ',%s*', '","Minecraft ' ) .. '")' ) end end makeQuery( 'fixVersion', args.fixedin ) makeQuery( 'fixVersion not', args.notfixedin ) makeQuery( 'affectedVersion', args.affected ) local text = issues .. ' issues fixed' if #trackerQuery > 0 then table.insert( trackerQuery, 'project = ' .. project:upper ) table.insert( trackerQuery, 'resolution = Fixed' ) text = '[https://bugs.mojang.com/issues/?jql=' .. mw.uri.encode( table.concat( trackerQuery, ' AND ' ) .. ' ORDER BY key' ) .. ' ' .. text .. ']'	end return ';' .. text .. '\n' .. table.concat( list, '\n' ) end return p