Redaxscript\Parser::_parseBlockcode PHP Method

_parseBlockcode() protected method

parse the blockcode tag
Since: 2.6.0
protected _parseBlockcode ( string $content = null ) : string
$content string content to be parsed
return string
    protected function _parseBlockcode($content = null)
    {
        $output = str_replace($this->_tagArray['blockcode']['search'], $this->_optionArray['delimiter'], $content);
        $partArray = array_filter(explode($this->_optionArray['delimiter'], $output));
        /* html elements */
        $preElement = new Html\Element();
        $preElement->init('pre', ['class' => $this->_optionArray['className']['blockcode']]);
        /* parse as needed */
        foreach ($partArray as $key => $value) {
            if ($key % 2) {
                $partArray[$key] = $preElement->copy()->html(htmlspecialchars($value, null, null, false));
            }
        }
        $output = implode($partArray);
        return $output;
    }