public static string RemovePersonData(ref string articleText)
{
string strPersonData = "", originalArticleText = articleText;
articleText = WikiRegexes.Persondata.Replace(articleText, m=>
{
strPersonData += (strPersonData.Length == 0 ? m.Value : Tools.Newline(m.Value));
return "";
});
// https://en.wikipedia.org/wiki/Wikipedia_talk:AutoWikiBrowser/Bugs/Archive_11#Persondata_comments
// catch the persondata comment the line before it so that the comment and template aren't separated
if (articleText.Contains(WikiRegexes.PersonDataCommentEN) && Variables.LangCode.Equals("en"))
{
articleText = articleText.Replace(WikiRegexes.PersonDataCommentEN, "");
strPersonData = WikiRegexes.PersonDataCommentEN + strPersonData;
}
if (!Tools.UnformattedTextNotChanged(originalArticleText, articleText))
{
articleText = originalArticleText;
strPersonData = "";
}
return strPersonData;
}