User:Yobot/Multiple issues old style

From Wikipedia, the free encyclopedia
//PRELIMINARY VERSION
//<summary>Replaces deprecated parameters and fixes common mistakes in {{tl|Multiple issues}}</summary>
//TODO: Add summary for every change
//TODO: Put all in the loop
//Load in Make List: Category:Articles using Multiple issues with deprecated parameters
        private static readonly Regex MI = Tools.NestedTemplateRegex(new List<string>("Multiple issues, Article issues, Multipleissues, Articleissues".Split(',')));
        public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
        {
            Summary = "Updated {{Multiple issues}} parameters";
            string ArticleText2 =  Tools.RemoveTemplateParameter(ArticleText,"Multiple issues","article");
                       // process each tag
            foreach(Match m in MI.Matches(ArticleText2))
            {
                string MICall = m.Value, newValue = m.Value;
 
		newValue = Tools.RenameTemplateParameter(newValue, "advertising", "advert");
		newValue = Tools.RenameTemplateParameter(newValue, "att", "do-attempt");
		newValue = Tools.RenameTemplateParameter(newValue, "biased", "POV");
		newValue = Tools.RenameTemplateParameter(newValue, "blpdispute", "disputed");
		newValue = Tools.RenameTemplateParameter(newValue, "fansite", "fanpov");
		newValue = Tools.RenameTemplateParameter(newValue, "intro-rewrite", "lead rewrite");
		newValue = Tools.RenameTemplateParameter(newValue, "leadtoolong", "lead too long");
		newValue = Tools.RenameTemplateParameter(newValue, "leadtooshort", "lead too short");
		newValue = Tools.RenameTemplateParameter(newValue, "moreref", "refimprove");
		newValue = Tools.RenameTemplateParameter(newValue, "morerefs", "refimprove");
		newValue = Tools.RenameTemplateParameter(newValue, "morereferences", "refimprove");
		newValue = Tools.RenameTemplateParameter(newValue, "noreferences", "unreferenced");
		newValue = Tools.RenameTemplateParameter(newValue, "OR", "original research");
		newValue = Tools.RenameTemplateParameter(newValue, "or", "original research");
		newValue = Tools.RenameTemplateParameter(newValue, "originalresearch", "original research");
		newValue = Tools.RenameTemplateParameter(newValue, "out of", "out of date");
		newValue = Tools.RenameTemplateParameter(newValue, "ref-improve", "refimprove");
		newValue = Tools.RenameTemplateParameter(newValue, "research", "original research");
		newValue = Tools.RenameTemplateParameter(newValue, "proseline", "prose");
		newValue = Tools.RenameTemplateParameter(newValue, "recent", "recentism");
		newValue = Tools.RenameTemplateParameter(newValue, "refimproveBLP", "BLP sources");
		newValue = Tools.RenameTemplateParameter(newValue, "toolong", "lead too long");
		newValue = Tools.RenameTemplateParameter(newValue, "tooshort", "lead too short");
		newValue = Tools.RenameTemplateParameter(newValue, "unref", "unreferenced");
                ArticleText2 = ArticleText2.Replace(m.Value, newValue);
            }
    Skip = false;
    // replace with the following line if you want AWB to skip if no changes made
    //Skip = (ArticleText2.Equals(ArticleText));
    ArticleText = ArticleText2;
    return ArticleText;
        }