1<?php
2
3declare(strict_types=1);
4
5/*
6 * This file is part of the league/commonmark package.
7 *
8 * (c) Colin O'Dell <colinodell@gmail.com>
9 *
10 * For the full copyright and license information, please view the LICENSE
11 * file that was distributed with this source code.
12 */
13
14namespace League\CommonMark\Extension\TableOfContents;
15
16use League\CommonMark\Node\Node;
17use League\CommonMark\Renderer\ChildNodeRendererInterface;
18use League\CommonMark\Renderer\NodeRendererInterface;
19use League\CommonMark\Xml\XmlNodeRendererInterface;
20
21final class TableOfContentsPlaceholderRenderer implements NodeRendererInterface, XmlNodeRendererInterface
22{
23    public function render(Node $node, ChildNodeRendererInterface $childRenderer): string
24    {
25        return '<!-- table of contents -->';
26    }
27
28    public function getXmlTagName(Node $node): string
29    {
30        return 'table_of_contents_placeholder';
31    }
32
33    /**
34     * @return array<string, scalar>
35     */
36    public function getXmlAttributes(Node $node): array
37    {
38        return [];
39    }
40}
41