apply method

String apply(
  1. Document document
)

Implementation

String apply(Document document) {
  if (document.doctype != null) {
    _buffer.write('<!doctype');

    if (document.doctype?.html != null) _buffer.write(' html');
    if (document.doctype?.public != null) _buffer.write(' public');

    if (document.doctype?.url != null) {
      _buffer.write('${document.doctype!.url}');
    }

    _buffer.writeln('>');
  }

  _formatChild(document.root, 0);

  return _buffer.toString().trim();
}