onAccepted method

  1. @override
void onAccepted(
  1. SpanNode parent
)
override

when this node was accepted by it's parent, onAccepted will be triggered

Implementation

@override
void onAccepted(SpanNode parent) {
  final textStyle = config.p.textStyle.merge(parentStyle);

  // Handle special tags
  for (var handler in (tagHandlers ?? [])) {
    if (text.contains(RegExp('<${handler.tag}[^>]*>'))) {
      customTag = handler.tag;
      customContent = contentFromText(handler.tag, text);
      customAttributes = attributesFromText(handler.tag, text);
      accept(ConcreteElementNode(tag: handler.tag));
      return;
    }
  }

  // Handle everything else
  accept(TextNode(text: text, style: textStyle));
}