Skip to content

Commit 779fdd0

Browse files
jderussefabpot
authored andcommitted
Fix call to deprecated "convertToHtml" method
1 parent bbc3377 commit 779fdd0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

extra/markdown-extra/LeagueMarkdown.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,20 @@
1616
class LeagueMarkdown implements MarkdownInterface
1717
{
1818
private $converter;
19+
private $legacySupport;
1920

2021
public function __construct(CommonMarkConverter $converter = null)
2122
{
2223
$this->converter = $converter ?: new CommonMarkConverter();
24+
$this->legacySupport = !method_exists($this->converter, 'convert');
2325
}
2426

2527
public function convert(string $body): string
2628
{
27-
return $this->converter->convertToHtml($body);
29+
if ($this->legacySupport) {
30+
return $this->converter->convertToHtml($body);
31+
}
32+
33+
return $this->converter->convert($body);
2834
}
2935
}

0 commit comments

Comments
 (0)