/// <summary> /// Validates that there are an equal number of opening and closing tags. /// If not, more detail is logged to the class log. /// </summary> /// <param name="text"></param> /// <returns></returns> public bool ValidateBalancedTags(string text) { int openTagNum = CountOccurrence(text, OpenTag.ToString()); int closeTagNum = CountOccurrence(text, CloseTag.ToString()); if (openTagNum != closeTagNum) { Log = string.Format("Not all tags in the string are closed. \nOpen: {0} Closed: {1} \n{2}", openTagNum, closeTagNum, text); return(false); } else { return(true); } }
public string Visit(CloseTag closeTag) { return("</span>"); }