Jump to content

User:Lightmouse/TestScript

From Wikipedia, the free encyclopedia

//

        WikiFunctions.Parse.HideText ht = new WikiFunctions.Parse.HideText(true, false, true);

        public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
        {
            Skip = false;
            Summary = "";

ArticleText = ht.Hide(ArticleText);

//Year: temporary change to protect preference dates
            ArticleText = Regex.Replace(ArticleText, @"(?i)(\[\[11 August\]\] )\[\[(\d{1,4})\]\]",  "$1xx$2xx");

//year: now remove unprotected linked years
            ArticleText = Regex.Replace(ArticleText, @"(?i)\[\[(\d{1,4})\]\]", "$1");
//year: #1. Undo temporary change to protect accessyear and date preference dates
            ArticleText = Regex.Replace(ArticleText, @"(?i)xx(\d{1,4})xx", "[[$1]]");


            return ht.AddBack(ArticleText);

//            return ArticleText;
        }
//