Example #1
0
        internal HtmlNode AddNode(HtmlTag tag)
        {
            var node = new HtmlNode(tag);
            Fragments.Add(node);

            return node;
        }
Example #2
0
        internal static HtmlText Create(string doc, HtmlTag startTag, HtmlTag endTag)
        {
            var startIndex = 0;

            if (startTag != null)
            {
                startIndex = startTag.StartIndex + startTag.Length;
            }

            var endIndex = doc.Length;

            if (endTag != null)
            {
                endIndex = endTag.StartIndex;
            }

            var text = new HtmlText(doc, startIndex, endIndex);
            if (text != null && !string.IsNullOrEmpty(text.Content))
            {
                return text;
            }

            return null;
        }
Example #3
0
 internal HtmlNode(HtmlTag openTag)
 {
     Name = openTag.Name.ToLowerInvariant();
     Attributes = openTag.Attributes;
 }