onMatchEnd method

  1. @override
bool onMatchEnd(
  1. InlineParser parser,
  2. Match match,
  3. TagState state
)
override

Implementation

@override
bool onMatchEnd(InlineParser parser, Match match, TagState state) {
  final runLength = match.group(0)!.length;
  final matchStart = parser.pos;
  final matchEnd = parser.pos + runLength - 1;
  final delimiterRun = _DelimiterRun.tryParse(parser, matchStart, matchEnd)!;
  if (!delimiterRun.isRightFlanking!) {
    return false;
  }

  parser.addNode(Element('del', state.children));
  return true;
}