public override void ExitHtmlDocument(HTMLParser.HtmlDocumentContext ctx) { var textContent = new StringBuilder(); foreach(var elemsCtx in ctx.htmlElements()){ var markup = MyTreeProperty.Get(elemsCtx); if(string.IsNullOrEmpty(markup)){ continue; } textContent.Append(markup); } _results.HtmlOnly = textContent.ToString(); }