Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| MarkdownConverter | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Hyde\Markdown; |
| 6 | |
| 7 | use League\CommonMark\Environment\Environment; |
| 8 | use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; |
| 9 | |
| 10 | /** |
| 11 | * The base Markdown converter class. |
| 12 | */ |
| 13 | class MarkdownConverter extends \League\CommonMark\MarkdownConverter |
| 14 | { |
| 15 | /** |
| 16 | * Create a new Markdown converter pre-configured for CommonMark. |
| 17 | * |
| 18 | * @param array<string, mixed> $config |
| 19 | */ |
| 20 | public function __construct(array $config = []) |
| 21 | { |
| 22 | $environment = new Environment($config); |
| 23 | $environment->addExtension(new CommonMarkCoreExtension()); |
| 24 | |
| 25 | parent::__construct($environment); |
| 26 | } |
| 27 | } |