Module:ComicSwitch

-- local p = {} local comicData = mw.loadData('Module:ComicSwitch/data')

function p.getSeries(frame) local issue= frame.args[1] local seriesName={} if comicData[issue] then seriesName= comicData[issue][1] else seriesName="Arrowverse Wiki" end if seriesName=="Arrow" then seriesName="Arrow (comic book series)" end return seriesName end

function p.comFormat(frame) local issue= frame.args[1] --page title-- local color= frame.args[2] local par = mw.ustring.len(issue) if issue=="Sistery Mystery (Reprise)" then par=par else if mw.ustring.find(issue,'(',1,true)==nil       then par = par        else par = mw.ustring.find(issue,'(',1,true)-2 end end local issueReal= mw.ustring.sub(issue,1,par) if issueReal=="Crisis on Infinite Earths Giant 1" then issueReal="Crisis on Infinite Earths Giant #1" end if issueReal=="Crisis on Infinite Earths Giant 2" then issueReal="Crisis on Infinite Earths Giant #2" end local hoverInfo ={} local issueForm ={} if comicData[issue] then if comicData[issue][2]==nil then hoverInfo=comicData[issue][3] ..")"   		else hoverInfo=comicData[issue][1]        		.." #"        		..comicData[issue][2]        		..")" end if comicData[issue][4] == nil then issueForm = issueReal else if issue=="REC." then issueForm="[REC.]" issueReal="[REC.]" else local par2=comicData[issue][4] local par3=mw.ustring.len(issueReal) issueForm="''" ..mw.ustring.sub(issueReal,1,par2) .."''"       					..mw.ustring.sub(issueReal,par2+1,par3) end end else hoverInfo="Arrowverse Wiki)"			issueForm=issueReal   end    local fullForm=""    if issueReal==issueForm    	then fullForm=""    end    if hoverInfo == "Arrowverse Wiki)" then fullForm=fullForm .."[[Category:"       	.."Broken Com link|"        	..issue        	.."]]" end return frame:preprocess(fullForm) end return p