Вход Регистрация
Файл: contao-3.5.8/system/modules/core/elements/ContentMarkdown.php
Строк: 49
<?php

/**
 * Contao Open Source CMS
 *
 * Copyright (c) 2005-2016 Leo Feyer
 *
 * @license LGPL-3.0+
 */

namespace Contao;


/**
 * Front end content element "code".
 *
 * @author Leo Feyer <https://github.com/leofeyer>
 */
class ContentMarkdown extends ContentElement
{

    
/**
     * Template
     * @var string
     */
    
protected $strTemplate 'ce_markdown';


    
/**
     * Return if the highlighter plugin is not loaded
     *
     * @return string
     */
    
public function generate()
    {
        if (
TL_MODE == 'BE')
        {
            
$return '<pre>'specialchars($this->code) .'</pre>';

            if (
$this->headline != '')
            {
                
$return '<'$this->hl .'>'$this->headline .'</'$this->hl .'>'$return;
            }

            return 
$return;
        }

        return 
parent::generate();
    }


    
/**
     * Generate the content element
     */
    
protected function compile()
    {
        
$this->code MichelfMarkdownExtra::defaultTransform($this->code);
        
$this->Template->content strip_tags($this->codeConfig::get('allowedTags'));
    }
}
Онлайн: 0
Реклама