visitElementBefore method

  1. @override
bool visitElementBefore(
  1. Element element
)

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

Returns false to skip its children.

Implementation

@override
bool visitElementBefore(m.Element element) {
  final node = getNodeByElement(element, config);
  final last = _spansStack.last;
  if (last is ElementNode) {
    last.accept(node);
    onNodeAccepted?.call(node, _currentSpanIndex);
  }
  _spansStack.add(node);

  return true;
}