canEndBlock method

  1. @override
bool canEndBlock(
  1. BlockParser parser
)
override

Implementation

@override
bool canEndBlock(BlockParser parser) {
  // An empty list cannot interrupt a paragraph. See
  // https://spec.commonmark.org/0.29/#example-255.
  // Ideally, [BlockSyntax.canEndBlock] should be changed to be a method
  // which accepts a [BlockParser], but this would be a breaking change,
  // so we're going with this temporarily.
  var match = pattern.firstMatch(parser.current)!;
  // The seventh group, in both [_olPattern] and [_ulPattern] is the text
  // after the delimiter.
  return match[7]?.isNotEmpty ?? false;
}