From 779fdd09b4f152b3cf598319c4026d48b9678bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Sat, 29 Jan 2022 15:06:54 +0100 Subject: [PATCH] Fix call to deprecated "convertToHtml" method --- extra/markdown-extra/LeagueMarkdown.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); } }