public override void VisitHtmlAttributeValue(HtmlAttributeValueIntermediateNode node)
 {
     for (var i = 0; i < node.Children.Count; i++)
     {
         if (node.Children[i] is IntermediateToken token)
         {
             Builder.Append(token.Content);
         }
     }
 }
示例#2
0
            public override void VisitHtmlAttributeValue(HtmlAttributeValueIntermediateNode node)
            {
                if (node.HasDiagnostics)
                {
                    // Treat node with errors as non-HTML
                    _foundNonHtml = true;
                }

                // Visit Children
                base.VisitDefault(node);
            }
 public virtual void VisitHtmlAttributeValue(HtmlAttributeValueIntermediateNode node)
 {
     VisitDefault(node);
 }
示例#4
0
 public override void VisitHtmlAttributeValue(HtmlAttributeValueIntermediateNode node)
 {
     Builder.Append(Encode(node.Children));
 }
示例#5
0
 public override void VisitHtmlAttributeValue(HtmlAttributeValueIntermediateNode node)
 {
     // Visit Children
     base.VisitDefault(node);
 }
示例#6
0
 public override void VisitHtmlAttributeValue(HtmlAttributeValueIntermediateNode node)
 {
     WriteContentNode(node, node.Prefix);
 }
示例#7
0
            public override void VisitTagHelperHtmlAttribute(TagHelperHtmlAttributeIntermediateNode node)
            {
                var attribute = new HtmlAttributeIntermediateNode()
                {
                    AttributeName = node.AttributeName,
                    Source        = node.Source,
                };

                _children.Add(attribute);

                for (var i = 0; i < node.Diagnostics.Count; i++)
                {
                    attribute.Diagnostics.Add(node.Diagnostics[i]);
                }

                switch (node.AttributeStructure)
                {
                case AttributeStructure.Minimized:

                    attribute.Prefix = node.AttributeName;
                    attribute.Suffix = string.Empty;
                    break;

                case AttributeStructure.NoQuotes:
                case AttributeStructure.SingleQuotes:
                case AttributeStructure.DoubleQuotes:

                    // We're ignoring attribute structure here for simplicity, it doesn't effect us.
                    attribute.Prefix = node.AttributeName + "=\"";
                    attribute.Suffix = "\"";

                    for (var i = 0; i < node.Children.Count; i++)
                    {
                        attribute.Children.Add(RewriteAttributeContent(node.Children[i]));
                    }

                    break;
                }

                IntermediateNode RewriteAttributeContent(IntermediateNode content)
                {
                    if (content is HtmlContentIntermediateNode html)
                    {
                        var value = new HtmlAttributeValueIntermediateNode()
                        {
                            Source = content.Source,
                        };

                        for (var i = 0; i < html.Children.Count; i++)
                        {
                            value.Children.Add(html.Children[i]);
                        }

                        for (var i = 0; i < html.Diagnostics.Count; i++)
                        {
                            value.Diagnostics.Add(html.Diagnostics[i]);
                        }

                        return(value);
                    }


                    return(content);
                }
            }
 public override void VisitHtmlAttributeValue(HtmlAttributeValueIntermediateNode node)
 {
     Context.NodeWriter.WriteHtmlAttributeValue(Context, node);
 }
 public abstract void WriteHtmlAttributeValue(CodeRenderingContext context, HtmlAttributeValueIntermediateNode node);