parseChildLines method

  1. @override
List<String> parseChildLines(
  1. BlockParser parser, [
  2. String? endBlock
])
override

Implementation

@override
List<String> parseChildLines(BlockParser parser, [String? endBlock]) {
  endBlock ??= '';

  final childLines = <String>[];
  parser.advance();

  while (!parser.isDone) {
    final match = pattern.firstMatch(parser.current);
    if (match == null || !match[1]!.startsWith(endBlock)) {
      childLines.add(parser.current);
      parser.advance();
    } else {
      parser.advance();
      break;
    }
  }

  return childLines;
}