Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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()));
            }
        }
Exemplo n.º 3
0
 /// <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)
 {
 }