3 || strspn(ltrim($line), $fence[0]) < $mw || !str_ends_with(rtrim($line), $fence[0]) ) { if ($indent > 0 && $leadingSpaces > 0) { if ($leadingSpaces < $indent) { $line = ltrim($line); } else { $line = substr($line, $indent); } } $content[] = $line; } else { break; } } $block = [ 'code', 'content' => implode("\n", $content), ]; if ($language !== '') { if (preg_match('/^[^ ]+/', $language, $match)) { $block['language'] = $this->unEscapeBackslash($match[0]); } } return [$block, $i]; } abstract protected function unEscapeBackslash($text); }