markdown = $parser; } /** * @return TwigFilter[] */ public function getFilters() { return [ new TwigFilter('md2html', [$this, 'markdownToHtml'], ['is_safe' => ['html']]), ]; } /** * Transforms the given Markdown content into HTML * * @param string $content * @return string */ public function markdownToHtml(string $content): string { return $this->markdown->toHtml($content); } }