public function block($text) { $pattern = '~<(code|pre)>(.+?)</\\1>|```(?:php)?\\s(.+?)\\n```~s'; $highlighted = preg_replace_callback($pattern, [$this, 'highlightCb'], $text); $text = $this->markdown->transform($highlighted); return trim($text); }