visitElement method

  1. @override
void visitElement(
  1. Element node
)
override

Implementation

@override
void visitElement(h.Element node) {
  final localName = node.localName ?? '';
  final mdElement = m.Element(localName, []);
  mdElement.attributes.addAll(node.attributes.cast());
  SpanNode spanNode = visitor.getNodeByElement(mdElement, visitor.config);
  if (spanNode is! ElementNode) {
    final n = ConcreteElementNode(tag: localName, style: parentStyle);
    n.accept(spanNode);
    spanNode = n;
  }
  final last = _spansStack.last;
  if (last is ElementNode) {
    last.accept(spanNode);
  }
  _spansStack.add(spanNode);
  for (var child in node.nodes.toList(growable: false)) {
    visit(child);
  }
  _spansStack.removeLast();
}