芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/www/vendor/league/commonmark/src/Extension/InlinesOnly/ChildRenderer.php
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace League\CommonMark\Extension\InlinesOnly; use League\CommonMark\Block\Element\AbstractBlock; use League\CommonMark\Block\Element\Document; use League\CommonMark\Block\Element\InlineContainerInterface; use League\CommonMark\Block\Renderer\BlockRendererInterface; use League\CommonMark\ElementRendererInterface; use League\CommonMark\Inline\Element\AbstractInline; /** * Simply renders child elements as-is, adding newlines as needed. */ final class ChildRenderer implements BlockRendererInterface { public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, bool $inTightList = false) { $out = ''; if ($block instanceof InlineContainerInterface) { /** @var iterable
$children */ $children = $block->children(); $out .= $htmlRenderer->renderInlines($children); } else { /** @var iterable
$children */ $children = $block->children(); $out .= $htmlRenderer->renderBlocks($children); } if (!($block instanceof Document)) { $out .= "\n"; } return $out; } }