diff --git a/extra/markdown-extra/LeagueMarkdown.php b/extra/markdown-extra/LeagueMarkdown.php index ed7e7dd329d..2390901c01e 100644 --- a/extra/markdown-extra/LeagueMarkdown.php +++ b/extra/markdown-extra/LeagueMarkdown.php @@ -16,14 +16,20 @@ class LeagueMarkdown implements MarkdownInterface { private $converter; + private $legacySupport; public function __construct(CommonMarkConverter $converter = null) { $this->converter = $converter ?: new CommonMarkConverter(); + $this->legacySupport = !method_exists($this->converter, 'convert'); } public function convert(string $body): string { - return $this->converter->convertToHtml($body); + if ($this->legacySupport) { + return $this->converter->convertToHtml($body); + } + + return $this->converter->convert($body); } }