コード例 #1
0
ファイル: AspNetParseTree.cs プロジェクト: nofuture-git/31g
        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)
 {
 }