public override void ExitHtmlComment(HTMLParser.HtmlCommentContext context) { var htmlCommentNode = context.HTML_COMMENT(); var htmlCommentText = htmlCommentNode?.GetText(); if (string.IsNullOrWhiteSpace(htmlCommentText)) { return; } _results.HtmlComments.Add(htmlCommentText); }
public override void EnterHtmlComment([NotNull] HTMLParser.HtmlCommentContext context) { if (!IncludeComments) { return; } var sb = new StringBuilder(context.GetText().Trim()); if (sb.Length.IsBetween(MinimumLength, MaximumLength)) { Emit(HttpUtility.HtmlDecode(sb.ToString())); } }
/// <summary> /// Exit a parse tree produced by <see cref="HTMLParser.htmlComment"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitHtmlComment([NotNull] HTMLParser.HtmlCommentContext context) { }