parseChildLines method

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

Implementation

@override
List<Line> parseChildLines(BlockParser parser) {
  final childLines = <Line>[];

  while (!parser.isDone) {
    final isBlankLine = parser.current.isBlankLine;
    if (isBlankLine && _shouldEnd(parser)) {
      break;
    }

    if (!isBlankLine &&
        childLines.isNotEmpty &&
        !pattern.hasMatch(parser.current.content)) {
      break;
    }

    childLines.add(Line(
      parser.current.content.dedent().text,
      tabRemaining: parser.current.tabRemaining,
    ));

    parser.advance();
  }

  return childLines;
}