Example #1
0
 private static ElementIndentStrategy CreateIndentStrategy(String tagName, HtmlElementPrinter printer)
 {
     if (BlockTagNames.ContainsKey(tagName))
     {
         return(new BlockElementIndentStrategy(printer));
     }
     else
     {
         return(new ElementIndentStrategy(printer));
     }
 }
Example #2
0
 public void WriteElementEnd(StringBuilder sb, bool requiresEndTag)
 {
     if (startTagState == START_TAG_STATE.OPENED && !requiresEndTag)
     {
         sb.Append(" /");
         CloseStartElement(sb);
     }
     else
     {
         CloseStartElement(sb);
         ApplyEndIndentStrategy(sb, stackDepth);
         sb.Append("</");
         sb.Append(tagName);
         sb.Append(">");
         if (BlockTagNames.ContainsKey(tagName))
         {
             sb.Append("\r\n");
         }
     }
 }