League\CommonMark\Inline\Renderer\HtmlInlineRenderer::render PHP Method

render() public method

public render ( AbstractInline $inline, League\CommonMark\ElementRendererInterface $htmlRenderer ) : string
$inline League\CommonMark\Inline\Element\AbstractInline
$htmlRenderer League\CommonMark\ElementRendererInterface
return string
    public function render(AbstractInline $inline, ElementRendererInterface $htmlRenderer)
    {
        if (!$inline instanceof HtmlInline) {
            throw new \InvalidArgumentException('Incompatible inline type: ' . get_class($inline));
        }
        // 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($inline->getContent(), ENT_NOQUOTES);
        }
        return $inline->getContent();
    }
HtmlInlineRenderer