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
16namespace DokuWiki\Plugin\Commonmark\Extension\Renderer\Inline;
17
18use League\CommonMark\Renderer\NodeRendererInterface;
19use League\CommonMark\Renderer\ChildNodeRendererInterface;
20use League\CommonMark\Node\Node;
21use League\CommonMark\Node\Inline\Text;
22use League\CommonMark\Util\Xml;
23
24final class TextRenderer implements NodeRendererInterface
25{
26    /**
27     * @param Text                     $inline
28     * @param ChildNodeRendererInterface $DWRenderer
29     *
30     * @return string
31     */
32    public function render(Node $node, ChildNodeRendererInterface $DWRenderer)
33    {
34        Text::assertInstanceOf($node);
35
36        //return Xml::escape($inline->getContent());
37        return $node->getLiteral();
38    }
39}
40