League\CommonMark\Block\Renderer\HtmlBlockRenderer::render PHP Method

render() public method

public render ( AbstractBlock $block, League\CommonMark\ElementRendererInterface $htmlRenderer, boolean $inTightList = false ) : string
$block League\CommonMark\Block\Element\AbstractBlock
$htmlRenderer League\CommonMark\ElementRendererInterface
$inTightList boolean
return string
    public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, $inTightList = false)
    {
        if (!$block instanceof HtmlBlock) {
            throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block));
        }
        // Kept for BC reasons
        if ($this->config->getConfig('safe') === true) {
            return '';
        }
        if ($this->config->getConfig('html_input') === Environment::HTML_INPUT_STRIP) {
            return '';
        }
        if ($this->config->getConfig('html_input') === Environment::HTML_INPUT_ESCAPE) {
            return htmlspecialchars($block->getStringContent(), ENT_NOQUOTES);
        }
        return $block->getStringContent();
    }