parse method

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

Implementation

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

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

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