public static void Main()
var html = "<inline_tag><inline_tag/>123</inline_tag>";
var htmlDoc = new HtmlDocument { OptionAutoCloseOnEnd = false };
PrintDetails(htmlDoc, "// expected 2 errors to be reported because 2 tags were unclosed (h1 and b)");
private static void PrintDetails(HtmlDocument htmlDoc, string expectedErrors) {
var errs = htmlDoc.ParseErrors;
Console.Write("error count: " + errs.Count());
Console.WriteLine(" " + expectedErrors);
Console.WriteLine(string.Join('\n', errs.Select(e => string.Format("{0}, {1}:{2}: {3}", e.Code, e.Line, e.LinePosition, e.Reason))));
Console.WriteLine("\nParsedText:\n" + htmlDoc.ParsedText);
Console.WriteLine("\nInnerHTML:\n" + htmlDoc.DocumentNode.InnerHtml.ToString());
Console.WriteLine("\nOuterHtml:\n" + htmlDoc.DocumentNode.OuterHtml.ToString());
Console.WriteLine(new String('_', 50) + new String('\n', 3));