public static string Process(HtmlParser.Node document) { Console.WriteLine("Post ======= {0}", document.Name); var bodyBuilder = new StringBuilder(); foreach (var node in document.Children) { ProcessNode(node, bodyBuilder); } return(bodyBuilder.ToString()); }
private static void ProcessNode(HtmlParser.Node node, StringBuilder bodyBuilder) { var converter = _converters.GetConverter(node); if (converter.OpenNode(node, bodyBuilder)) { // the converter returning true signifies that we are expecting // this node to have children and we should parse them foreach (var child in node.Children) { ProcessNode(child, bodyBuilder); } } converter.CloseNode(node, bodyBuilder); }