parse method

  1. @override
Node parse(
  1. BlockParser parser
)
override

Implementation

@override
Node parse(BlockParser parser) {
  final childLines = <String>[];

  // Eat until we hit something that ends a paragraph.
  while (!BlockSyntax.isAtBlockEnd(parser)) {
    childLines.add(parser.current);
    parser.advance();
  }

  final paragraphLines = _extractReflinkDefinitions(parser, childLines);
  if (paragraphLines == null) {
    // Paragraph consisted solely of reference link definitions.
    return Text('');
  } else {
    final contents = UnparsedContent(paragraphLines.join('\n'));
    return Element('p', [contents]);
  }
}