예제 #1
0
        public override void ExitEmptyAttr(HTMLParser.EmptyAttrContext ctx)
        {
            var attrNameCtx = ctx.htmlAttributeName();

            if (attrNameCtx == null)
            {
                return;
            }
            var attrNameText = MyTreeProperty.Get(attrNameCtx);

            if (string.IsNullOrEmpty(attrNameText))
            {
                return;
            }

            //TODO swap attributes name with name-value pair here
            if (_results.EmptyAttrs.All(x => attrNameText != x))
            {
                _results.EmptyAttrs.Add(attrNameText);
            }

            FilteredPut(ctx, attrNameText + "='true'");
        }
예제 #2
0
 /// <summary>
 /// Exit a parse tree produced by the <c>emptyAttr</c>
 /// labeled alternative in <see cref="HTMLParser.htmlAttribute"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitEmptyAttr([NotNull] HTMLParser.EmptyAttrContext context)
 {
 }