createNode method

Node createNode(
  1. InlineParser parser,
  2. String destination,
  3. String? title, {
  4. required List<Node> getChildren(),
})

Create the node represented by a Markdown link.

Implementation

Node createNode(InlineParser parser, String destination, String? title,
    {required List<Node> Function() getChildren}) {
  var children = getChildren();
  var element = Element('a', children);
  element.attributes['href'] = escapeAttribute(destination);
  if (title != null && title.isNotEmpty) {
    element.attributes['title'] = escapeAttribute(title);
  }
  return element;
}