daux.io/libs/Format/Confluence/ContentTypes/Markdown/IndentedCodeRenderer.php
Stéphane Goetz 59b8c04161 Confluences bugfixes, Fix documentation
Make it easier to spot where an error comes from when uploading to confluence.
Allow to upload documentation without a prefix.
2017-11-06 22:46:07 +01:00

26 lines
828 B
PHP

<?php namespace Todaymade\Daux\Format\Confluence\ContentTypes\Markdown;
use League\CommonMark\Block\Element\AbstractBlock;
use League\CommonMark\Block\Element\IndentedCode;
use League\CommonMark\ElementRendererInterface;
use League\CommonMark\HtmlElement;
class IndentedCodeRenderer extends CodeRenderer
{
/**
* @param AbstractBlock $block
* @param HtmlRendererInterface $htmlRenderer
* @param bool $inTightList
*
* @return HtmlElement
*/
public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, $inTightList = false)
{
if (!($block instanceof IndentedCode)) {
throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block));
}
return $this->getHTMLElement($block->getStringContent(), "");
}
}