Module:CrossSwitch

-- local p = {} local crossData = mw.loadData('Module:CrossSwitch/data') function p.crossFormat(frame) local crossover= frame.args[1] local color=frame.args[2] local length= mw.ustring.len(crossover) local par={} if mw.ustring.find(crossover,'(',1,true)==nil       then par=length        else par=mw.ustring.find(crossover,'(',1,true)-2 end local title=mw.ustring.sub(crossover,1,par) if crossover=="Flash vs. Arrow" then crossover="Flash vs. Arrow (crossover event)" end local hoverInfo={} if crossData[title] then hoverInfo="" else hoverInfo=""           ..frame.args[1]            .."" end return frame:preprocess(hoverInfo) end

function p.getImage(frame) local crossover=frame.args[1] local length= mw.ustring.len(crossover) local par={} if mw.ustring.find(crossover,'(',1,true)==nil       then par=length        else par=mw.ustring.find(crossover,'(',1,true)-2 end crossover=mw.ustring.sub(crossover,1,par) local image={} if crossData[crossover] then image=crossData[crossover][3] ..".png" else image="Wiki-wordmark.png" end return image end return p