close method

Node? close(
  1. InlineParser parser,
  2. Delimiter opener,
  3. Delimiter closer, {
  4. 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 Node incorpororates these child nodes.

Implementation

Node? close(InlineParser parser, Delimiter opener, Delimiter closer,
    {required List<Node> Function() getChildren}) {
  var strong = opener.length >= 2 && closer.length >= 2;
  return Element(strong ? 'strong' : 'em', getChildren());
}