parse method

  1. @override
Node parse(
  1. BlockParser parser
)
override

Implementation

@override
Node parse(BlockParser parser) {
  final childLines = parseChildLines(parser);

  // The Markdown tests expect a trailing newline.
  childLines.add(Line(''));

  var content = childLines
      .map((e) => e.content.prependSpace(e.tabRemaining ?? 0))
      .join('\n');
  if (parser.document.encodeHtml) {
    content = escapeHtml(content, escapeApos: false);
  }

  return Element('pre', [Element.text('code', content)]);
}