parseChildLines method

  1. @override
List<String> parseChildLines(
  1. BlockParser parser
)
override

Implementation

@override
List<String> parseChildLines(BlockParser parser) {
  // Grab all of the lines that form the blockquote, stripping off the ">".
  var childLines = <String>[];

  while (!parser.isDone) {
    var match = pattern.firstMatch(parser.current);
    if (match != null) {
      childLines.add(match[1]!);
      parser.advance();
      continue;
    }

    // A paragraph continuation is OK. This is content that cannot be parsed
    // as any other syntax except Paragraph, and it doesn't match the bar in
    // a Setext header.
    if (parser.blockSyntaxes.firstWhere((s) => s.canParse(parser))
        is ParagraphSyntax) {
      childLines.add(parser.current);
      parser.advance();
    } else {
      break;
    }
  }

  return childLines;
}