| 1 | <?php |
||
| 16 | class MarkdownHelpers implements HelpersInterface |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * Store the Markdown parser. |
||
| 20 | * |
||
| 21 | * @var Parsedown |
||
| 22 | */ |
||
| 23 | private $parsedown; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param array $data Class Dependencies. |
||
| 27 | */ |
||
| 28 | public function __construct(array $data) |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Retrieve the helpers. |
||
| 35 | * |
||
| 36 | * @return array |
||
| 37 | */ |
||
| 38 | public function toArray(): array |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Magic: Render the Mustache section. |
||
| 47 | * |
||
| 48 | * @param string $text The Markdown text to parse. |
||
| 49 | * @param LambdaHelper|null $helper For rendering strings in the current context. |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | public function __invoke($text, LambdaHelper $helper = null): string |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Set the Markdown parser. |
||
| 62 | * |
||
| 63 | * @param Parsedown $parser Thar Markdown parser. |
||
| 64 | * @return void |
||
| 65 | */ |
||
| 66 | private function setParsedown(Parsedown $parser): void |
||
| 70 | } |
||
| 71 |