Jump to content

User:Yobot/Multiple issues

From Wikipedia, the free encyclopedia
//<summary>Converts old style {{tl|Multiple issues}} to new style</summary>
        public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
        {
            Skip = false;
            Summary = "Convert Multiple issues to new style";
            //Summary = "";
            string MI=WikiRegexes.MultipleIssues.Match(ArticleText).Value;
            List<string> parameters= new List<string>("abbreviations,ad,advert,all plot,autobiography,bare references,bareurl,biblio,BLP sources,BLPsources,BLP IMDB refimprove,BLP IMDb refimprove,BLP IMDb-only refimprove,BLP unsourced,capitalization,citation style,cleanup,cleanup-laundry,cleanup-link rot,cleanup-reorganize,cleanup-rewrite,cleanup-spam,citation style,citations,citationstyle,cite check,citecheck,citations missing,COI,coi,colloquial,confusing,context,contradict,copy edit,copyedit,criticism section,crystal,dead end,deadend,disputed,essay,essay-like,example farm,examplefarm,external links,fancruft,fanpov,fansite,fiction,game guide,gameguide,histinfo,hoax,howto,inappropriate person,inappropriate tone,incomplete,intromissing,introrewrite,intro-tooshort,in-universe,jargon,globalize,globalise,laundry,lead missing,lead rewrite,lead too long,lead too short,like resume,like-resume,likeresume,link rot,linkrot,long,more footnotes,news release,newsrelease,no footnotes,notability,notable,npov,NPOV,original research,onesource,one source,orphan,out of date,over-quotation,over detailed,overly detailed,peacock,plot,POV,pov,pov-check,POV-check,primarysources,primary sources,prose,quote farm,recentism,references,refimprove,restructure,review,rewrite,sections,self-published,story,synthesis,technical,tone,travel guide,travelguide,trivia,unbalanced,underlinked,unreferenced,unref,unreliable sources,unreliable,unsourced,update,very long,verylong,weasel".Split(','));

            List<string> values=Tools.GetTemplateParametersValues(MI, parameters);
            for (int i = 0; i < values.Count; i++)
            {
               if (values[i].Length > 0)
               {
                 ArticleText = @"{{"+parameters[i]+@"|date="+values[i] + @"}}" + "\r\n" + ArticleText;
                 ArticleText = ArticleText.Replace(MI,Tools.RemoveTemplateParameter(MI, parameters[i]));
                 MI=WikiRegexes.MultipleIssues.Match(ArticleText).Value;
               }
            }
            return ArticleText;
        }