| 1 | <?php |
||
| 13 | final class MarkdownParser implements MDParser |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var ParsedownExtra |
||
| 17 | */ |
||
| 18 | private ParsedownExtra $interpreter; |
||
|
|
|||
| 19 | |||
| 20 | /** |
||
| 21 | * MarkdownParser constructor. |
||
| 22 | */ |
||
| 23 | public function __construct(ParsedownExtra $interpreter) |
||
| 24 | { |
||
| 25 | $this->interpreter = $interpreter; |
||
| 26 | } |
||
| 27 | |||
| 28 | public function parse(string $text): string |
||
| 29 | { |
||
| 30 | return $this->interpreter->text($text); |
||
| 31 | } |
||
| 32 | } |
||
| 33 |