canParse method

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

Implementation

@override
bool canParse(BlockParser parser) {
  final match = pattern.firstMatch(parser.current);
  if (match == null) return false;
  final codeFence = match.group(1)!;
  final infoString = match.group(2);
  // From the CommonMark spec:
  //
  // > If the info string comes after a backtick fence, it may not contain
  // > any backtick characters.
  return (codeFence.codeUnitAt(0) != $backquote ||
      !infoString!.codeUnits.contains($backquote));
}