parser = new ParsedownExtension(); $this->parser->setUrlsLinked(true); $this->parser->setBreaksEnabled(true); } /** * @param string $text * @param bool $safe * @return string */ public function toHtml(string $text, bool $safe = true): string { $this->parser->setSafeMode($safe); return $this->parser->text($text); } }