canParse method

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

Implementation

@override
bool canParse(BlockParser parser) {
  // Check if it matches `hrPattern`, otherwise it will produce an infinite
  // loop if put `UnorderedListSyntax` or `UnorderedListWithCheckboxSyntax`
  // bofore `HorizontalRuleSyntax` and parse:
  // ```
  // * * *
  // ```
  if (hrPattern.hasMatch(parser.current.content)) {
    return false;
  }

  return pattern.hasMatch(parser.current.content);
}