public HtmlTagNode?Add(HtmlTag tag) { if (!CanAdd(tag)) { throw new Exception(); } var result = new HtmlTagNode(this, tag); _items.Add(result); return(tag.Name == '/' + Tag.Name ? Parent : result); }
public HtmlTagNode(HtmlTagNode parent, HtmlTag tag) : this(false, tag) { Parent = parent ?? throw new ArgumentNullException(nameof(parent)); }