private string TagCodeBlocks(string body)
{
var tagged = body;
var m = codeBlock.Match(tagged);
while (m.Success)
{
var code = tagged.Substring(m.Index, m.Length);
var lines = code.Split('\n');
tagged = tagged.Remove(m.Index, m.Length);
if (lines.Length < 4)
{
tagged = tagged.Insert(m.Index, " •CBS• ");
}
else if (lines.Length < 26)
{
tagged = tagged.Insert(m.Index, " •CBM• ");
}
else
{
tagged = tagged.Insert(m.Index, " •CBL• ");
}
m = codeBlock.Match(tagged);
}
return tagged;
}