close method

Iterable<Node>? close(
  1. InlineParser parser,
  2. Delimiter opener,
  3. Delimiter closer, {
  4. required String tag,
  5. required List<Node> getChildren(),
})

Attempts to close this tag at the current position.

If a tag cannot be closed at the current position (for example, if a link reference cannot be found for a link tag's label), then null is returned.

If a tag can be closed at the current position, then this method calls getChildren, in which parser parses any nested text into child nodes. The returned Iterable includes these children nodes.

Implementation

Iterable<Node>? close(
  InlineParser parser,
  Delimiter opener,
  Delimiter closer, {
  required String tag,
  required List<Node> Function() getChildren,
}) {
  return [Element(tag, getChildren())];
}