private bool FinilizeNodes(int position, ref HtmlNode current) { if (current != null) { current.Finilize(position); while (current.Parent != null) { current = current.GetParent(); current.Finilize(position); } } return current != null; }
private bool CloseOpenedChilds(HtmlNode current, string closeTag, int textEnd, int htmlEnd, ref HtmlNode newNode) { bool tagFound = false; if (current != null) { if (string.Compare(current.Tag, closeTag, StringComparison.InvariantCultureIgnoreCase) == 0 && current.IsOpened) { current.SetBoundary(textEnd, htmlEnd); newNode = current; return true; } tagFound = CloseOpenedChilds(current.GetParent(), closeTag, textEnd, htmlEnd, ref newNode); if (tagFound) { current.Finilize(textEnd); } } return tagFound; }