anchorHtmlSyntax function

AttributedText? anchorHtmlSyntax(
  1. Element element,
  2. AttributedText text
)

Implementation

AttributedText? anchorHtmlSyntax(md.Element element, AttributedText text) {
  if (element.tag != 'a') {
    return null;
  }

  return text
    ..addAttribution(
      LinkAttribution.fromUri(Uri.parse(element.attributes['href']!)),
      SpanRange(0, text.length - 1),
    );
}