WikiFunctions.Parse.HideText.HideUnformatted C# (CSharp) Method

HideUnformatted() public method

Hides unformatted text regions: nowiki, pre, math, html comments, timelines
public HideUnformatted ( string articleText ) : string
articleText string The wiki text of the article.
return string
        public string HideUnformatted(string articleText)
        {
            HiddenUnformattedText.Clear();

            Replace(WikiRegexes.UnformattedText.Matches(articleText), ref articleText, HiddenUnformattedText);

            return articleText;
        }

Usage Example

Example #1
0
        public string SubstituteTemplates(string ArticleText, string ArticleTitle)
        {
            if (Regexes.Count == 0)
            {
                return(ArticleText);                    // nothing to substitute
            }
            if (chkIgnoreUnformatted.Checked)
            {
                ArticleText = RemoveUnformatted.HideUnformatted(ArticleText);
            }
            if (!chkUseExpandTemplates.Checked)
            {
                foreach (KeyValuePair <Regex, string> p in Regexes)
                {
                    ArticleText = p.Key.Replace(ArticleText, p.Value);
                }
            }
            else
            {
                ArticleText = Tools.ExpandTemplate(ArticleText, ArticleTitle, Regexes, chkIncludeComment.Checked);
            }

            if (chkIgnoreUnformatted.Checked)
            {
                ArticleText = RemoveUnformatted.AddBackUnformatted(ArticleText);
            }

            return(ArticleText);
        }
All Usage Examples Of WikiFunctions.Parse.HideText::HideUnformatted