Twig/Extension/SimpleContentExtension.php
protected function renderContent(ContentBlock $block)
    {
        $content = $block->getContent();

        switch ($block->getType())
        {
            case 'line':
                $content = htmlspecialchars($content);
                break;

            case 'text':
                $content = htmlspecialchars($content);
                $content = str_replace("\n", '<br>', $content);
                break;

            case 'markdown':
                $content = $this->markdownHelper->transform($content);
                break;

            case 'html':
                break;

            default:
                throw new \InvalidArgumentException('Unknown content block type: ' . $block->getType());
        }

        return $content;
    }
protected function renderContent(ContentBlock $block)
    {
        $content = $block->getContent();

        switch ($block->getType())
        {
            case 'line':
                $content = htmlspecialchars($content);
                break;

            case 'text':
                $content = htmlspecialchars($content);
                $content = str_replace("\n", '<br>', $content);
                break;

            case 'markdown':
                $content = $this->markdownHelper->transform($content);
                break;

            case 'html':
                break;

            default:
                throw new \InvalidArgumentException('Unknown content block type: ' . $block->getType());
        }

        return $content;
    }
protected function renderContent ( ContentBlock $ block ) { $ content = $ block -> getContent ( ) ; switch ( $ block -> getType ( ) ) { case 'line' : $ content = htmlspecialchars ( $ content ) ; break ; case 'text' : $ content = htmlspecialchars ( $ content ) ; $ content = str_replace ( "\n" , '<br>' , $ content ) ; break ; case 'markdown' : $ content = $ this -> markdownHelper -> transform ( $ content ) ; break ; case 'html' : break ; default : throw new \ InvalidArgumentException ( 'Unknown content block type: ' . $ block -> getType ( ) ) ; } return $ content ; }
Render the given ContentBlock, HTML-escaping the content where necessary.

@throws \InvalidArgumentException    If given type is unknown

@param ContentBlock $block

@return string
Render the given ContentBlock HTML - escaping the content where necessary .