visitElementAfter method

  1. @override
void visitElementAfter(
  1. Element element
)
override

Called when an Element has been reached, after its children have been visited.

Will not be called if visitElementBefore returns false.

Implementation

@override
void visitElementAfter(Element element) {
  assert(identical(_elementStack.last, element));

  if (element.children != null &&
      element.children!.isNotEmpty &&
      _blockTags.contains(_lastVisitedTag) &&
      _blockTags.contains(element.tag)) {
    buffer.writeln();
  } else if (element.tag == 'blockquote') {
    buffer.writeln();
  }
  buffer.write('</${element.tag}>');

  _lastVisitedTag = _elementStack.removeLast().tag;
}