createNode method
Element
createNode(
- InlineParser parser,
- String destination,
- String? title, {
- required List<
Node> getChildren(),
override
Create the node represented by a Markdown link.
Implementation
@override
Element createNode(InlineParser parser, String destination, String? title,
{required List<Node> Function() getChildren}) {
var element = Element.empty('img');
var children = getChildren();
element.attributes['src'] = destination;
element.attributes['alt'] = children.map((node) => node.textContent).join();
if (title != null && title.isNotEmpty) {
element.attributes['title'] =
escapeAttribute(title.replaceAll('&', '&'));
}
return element;
}