Esempio n. 1
0
  void outerHtmlHead(StringBuilder accum, int depth, Document.OutputSettings out) {
    if (accum.length() > 0
        && out.prettyPrint()
        && (tag.formatAsBlock()
            || (parent() != null && parent().tag().formatAsBlock())
            || out.outline())) indent(accum, depth, out);
    accum.append("<").append(tagName());
    attributes.html(accum, out);

    if (childNodes.isEmpty() && tag.isSelfClosing()) accum.append(" />");
    else accum.append(">");
  }
Esempio n. 2
0
 void outerHtmlTail(StringBuilder accum, int depth, Document.OutputSettings out) {
   if (!(childNodes.isEmpty() && tag.isSelfClosing())) {
     if (out.prettyPrint()
         && (!childNodes.isEmpty()
             && (tag.formatAsBlock()
                 || (out.outline()
                     && (childNodes.size() > 1
                         || (childNodes.size() == 1
                             && !(childNodes.get(0) instanceof TextNode)))))))
       indent(accum, depth, out);
     accum.append("</").append(tagName()).append(">");
   }
 }