public override string VisitHtmlChardata([NotNull] HTMLParser.HtmlChardataContext context)
 {
     // this should just extract out the text of the HTML
     if (inTitle)
     {
         Console.WriteLine(context.HTML_TEXT());
     }
     return(base.VisitHtmlChardata(context));
 }
Beispiel #2
0
        public override void ExitHtmlChardata(HTMLParser.HtmlChardataContext context)
        {
            if (string.IsNullOrWhiteSpace(context.GetText()))
            {
                return;
            }
            var cdatatxt = context.GetText().Trim();

            cdatatxt = cdatatxt.EscapeString(EscapeStringType.XML);
            _results.CharData.Add(cdatatxt);
            FilteredPut(context, cdatatxt);
        }
Beispiel #3
0
        public override void EnterHtmlChardata([NotNull] HTMLParser.HtmlChardataContext context)
        {
            if (!IncludeChardata)
            {
                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.htmlChardata"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitHtmlChardata([NotNull] HTMLParser.HtmlChardataContext context)
 {
 }