1656793f4SSungbin Jeon<?php 2656793f4SSungbin Jeon 3656793f4SSungbin Jeondeclare(strict_types=1); 4656793f4SSungbin Jeon 5656793f4SSungbin Jeon/* 6656793f4SSungbin Jeon * This file is part of the clockoon/dokuwiki-commonmark-plugin package. 7656793f4SSungbin Jeon * 8656793f4SSungbin Jeon * (c) Sungbin Jeon <clockoon@gmail.com> 9656793f4SSungbin Jeon * 10656793f4SSungbin Jeon * Original code based on the followings: 11656793f4SSungbin Jeon * - CommonMark JS reference parser (https://bitly.com/commonmark-js) (c) John MacFarlane 12656793f4SSungbin Jeon * - league/commonmark (https://github.com/thephpleague/commonmark) (c) Colin O'Dell <colinodell@gmail.com> 13656793f4SSungbin Jeon * - Commonmark Table extension (c) Martin Hasoň <martin.hason@gmail.com>, Webuni s.r.o. <info@webuni.cz>, Colin O'Dell <colinodell@gmail.com> 14656793f4SSungbin Jeon * 15656793f4SSungbin Jeon * For the full copyright and license information, please view the LICENSE 16656793f4SSungbin Jeon * file that was distributed with this source code. 17656793f4SSungbin Jeon */ 18656793f4SSungbin Jeon 19656793f4SSungbin Jeonnamespace DokuWiki\Plugin\Commonmark\Extension\Renderer\Block; 20656793f4SSungbin Jeon 21*b0a36678SSungbin Jeonuse League\CommonMark\Node\Node; 2294a075eeSSungbin Jeonuse League\CommonMark\Renderer\NodeRendererInterface; 23*b0a36678SSungbin Jeonuse League\CommonMark\Renderer\ChildNodeRendererInterface; 24656793f4SSungbin Jeonuse League\CommonMark\Extension\Table\TableSection; 25656793f4SSungbin Jeon 2694a075eeSSungbin Jeonfinal class TableSectionRenderer implements NodeRendererInterface 27656793f4SSungbin Jeon{ 28*b0a36678SSungbin Jeon public function render(Node $node, ChildNodeRendererInterface $DWRenderer) 29656793f4SSungbin Jeon { 30*b0a36678SSungbin Jeon TableSection::assertInstanceOf($node); 31656793f4SSungbin Jeon 32*b0a36678SSungbin Jeon if (!$node->hasChildren()) { 33656793f4SSungbin Jeon return ''; 34656793f4SSungbin Jeon } 35656793f4SSungbin Jeon 36*b0a36678SSungbin Jeon $result = $DWRenderer->renderNodes($node->children()); 37656793f4SSungbin Jeon return $result; 38656793f4SSungbin Jeon 39656793f4SSungbin Jeon } 40656793f4SSungbin Jeon} 41