-- This module implements {{team roster navbox}}localme={}localNavbox=require('Module:Navbox')localfunctioncolorlinks(v,s)ifvandv~=''andsands~=''thenifnotmw.ustring.match(v,'<span style')thenv=mw.ustring.gsub(v,'%[%[([^%[%]|]*)%]%]','[[%1|<span style="'..s..'>%1</span>]]')v=mw.ustring.gsub(v,'%[%[([^%[%]|]*)|([^%[%]|]*)%]%]','[[%1|<span style="'..s..'>%2</span>]]')endendreturnvendlocalfunctionextractstyle(v)localr=''localslist=mw.text.split(mw.ustring.gsub(mw.ustring.gsub(vor'','&#[Xx]23;','#'),'#','#'),';')fork=1,#slistdolocals=slist[k]ifs:match('^[%s]*background')ors:match('^[%s]*color')thenr=r..s..';'endendreturnrendfunctionme.generateRosterNavbox(frame)localargs={}localparentArgs=frame:getParent().args-- Massage the styles for coloring the linkslocalbasestyle=extractstyle(parentArgs['basestyle']or'')localtitlestyle=extractstyle(parentArgs['titlestyle']or'')localabovestyle=extractstyle(parentArgs['abovestyle']or'')localgroupstyle=extractstyle(parentArgs['groupstyle']or'')localbelowstyle=extractstyle(parentArgs['belowstyle']or'')ifbasestyle~=''thentitlestyle=basestyle..';'..titlestyleabovestyle=basestyle..';'..abovestylegroupstyle=basestyle..';'..groupstylebelowstyle=basestyle..';'..belowstyleend-- Color links before passing them to the Navbox helper functionforargName,valueinpairs(parentArgs)doifvalue~=''theniftype(argName)=='string'thenifargName=='title'thenvalue=colorlinks(value,titlestyle)elseifargName=='above'thenvalue=colorlinks(value,abovestyle)elseifmw.ustring.find(argName,'^group[0-9]')thenvalue=colorlinks(value,groupstyle)elseifargName=='below'thenvalue=colorlinks(value,belowstyle)endargs[argName]=valueendendendargs['nowrapitems']='yes'-- Note Navbox.navbox() has a kludge to order the parent frame's args-- into a specific order. For now, this is omitted from this module.returnNavbox._navbox(args)end-- function me.generateRosterNavboxreturnme