/// <summary> /// Utility for properly printing the end tag for an element. /// This utility takes care of including/suppressing end tags for empty nodes properly. /// </summary> /// <param name="writer"></param> /// <param name="element"></param> private static void printElementEnd(HtmlWriter writer, IHTMLElement element) { // No tagName, no end tag. if (string.IsNullOrEmpty(element.tagName)) { return; } if (ElementFilters.RequiresEndTag(element)) { writer.WriteEndElement(true); } else { writer.WriteEndElement(false); } }