1<?php
2
3/*
4 * This file is part of the clockoon/dokuwiki-commonmark-plugin package.
5 *
6 * (c) Sungbin Jeon <clockoon@gmail.com>
7 *
8 * Original code based on the followings:
9 * - CommonMark JS reference parser (https://bitly.com/commonmark-js) (c) John MacFarlane
10 * - league/commonmark (https://github.com/thephpleague/commonmark) (c) Colin O'Dell <colinodell@gmail.com>
11 *
12 * For the full copyright and license information, please view the LICENSE
13 * file that was distributed with this source code.
14 */
15
16declare(strict_types=1);
17
18namespace DokuWiki\Plugin\Commonmark\Extension\Renderer\Block;
19
20use League\CommonMark\Block\Element\AbstractBlock;
21use League\CommonMark\Block\Renderer\BlockRendererInterface;
22use League\CommonMark\ElementRendererInterface;
23use League\CommonMark\Extension\Footnote\Node\Footnote;
24use League\CommonMark\Util\ConfigurationAwareInterface;
25use League\CommonMark\Util\ConfigurationInterface;
26
27final class FootnoteRenderer implements BlockRendererInterface, ConfigurationAwareInterface
28{
29    /** @var ConfigurationInterface */
30    private $config;
31
32    /**
33     * @param Footnote                 $block
34     * @param ElementRendererInterface $htmlRenderer
35     * @param bool                     $inTightList
36     *
37     * @return HtmlElement
38     */
39    public function render(AbstractBlock $block, ElementRendererInterface $DWRenderer, bool $inTightList = false)
40    {
41        if (!($block instanceof Footnote)) {
42            throw new \InvalidArgumentException('Incompatible block type: ' . \get_class($block));
43        }
44
45        return '';
46    }
47
48    public function setConfiguration(ConfigurationInterface $configuration)
49    {
50        $this->config = $configuration;
51    }
52}
53