2 && ltrim($code, ' ') !== '' && substr($code, 0, 1) === ' ' && substr($code, -1) === ' ' ) { $code = substr($code, 1, -1); } return [ [ 'inlineCode', $code, ], strlen($matches[0]) ]; } return [['text', $text[0]], 1]; } protected function renderInlineCode($block): string { if (in_array('table', $this->context)) { // Unescape pipes if inside a table cell. $block[1] = str_replace('\|', '|', $block[1]); } return '' . $this->escapeHtmlEntities( $block[1], ENT_COMPAT | ENT_SUBSTITUTE ) . ''; } abstract protected function escapeHtmlEntities($text, $flags = 0); }