toHtml method

String toHtml()

serializes the tree back to a HTML string

Implementation

String toHtml() {
  if (isCustomTag) {
    String html = startTagName;

    for (NodeV2 child in children) {
      html += child.toHtml();
    }

    return html + endTagName;
  } else {
    String html = startHtmlTag;

    for (NodeV2 child in children) {
      html += child.toHtml();
    }

    return html + endHtmlTag;
  }
}