onMatch method

  1. @override
bool onMatch(
  1. InlineParser parser,
  2. Match match
)

Processes match, adding nodes to parser and possibly advancing parser.

Returns whether the caller should advance parser by match[0].length.

Implementation

@override
bool onMatch(m.InlineParser parser, Match match) {
  m.Element el = m.Element.withTag('input');
  el.attributes['type'] = 'checkbox';
  el.attributes['disabled'] = 'true';
  el.attributes['checked'] = '${match[1]!.trim().isNotEmpty}';
  parser.addNode(el);
  return true;
}