public function markdown($content)
    {
        // Parse the field as Markdown, return HTML
        $output = $this->markdown->text($content);

        $config = $this->config->get('general/htmlcleaner');
        $allowedTags = !empty($config['allowed_tags']) ? $config['allowed_tags'] :
            ['div', 'p', 'br', 'hr', 's', 'u', 'strong', 'em', 'i', 'b', 'li', 'ul', 'ol', 'blockquote', 'pre', 'code', 'tt', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'dd', 'dl', 'dh', 'table', 'tbody', 'thead', 'tfoot', 'th', 'td', 'tr', 'a', 'img'];
        $allowedAttributes = !empty($config['allowed_attributes']) ? $config['allowed_attributes'] :
            ['id', 'class', 'name', 'value', 'href', 'src'];

        // Sanitize/clean the HTML.
        $maid = new Maid(
            [
                'output-format'   => 'html',
                'allowed-tags'    => $allowedTags,
                'allowed-attribs' => $allowedAttributes,
            ]
        );
        $output = $maid->clean($output);

        return $output;
    }
public function markdown($content)
    {
        // Parse the field as Markdown, return HTML
        $output = $this->markdown->text($content);

        $config = $this->config->get('general/htmlcleaner');
        $allowedTags = !empty($config['allowed_tags']) ? $config['allowed_tags'] :
            ['div', 'p', 'br', 'hr', 's', 'u', 'strong', 'em', 'i', 'b', 'li', 'ul', 'ol', 'blockquote', 'pre', 'code', 'tt', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'dd', 'dl', 'dh', 'table', 'tbody', 'thead', 'tfoot', 'th', 'td', 'tr', 'a', 'img'];
        $allowedAttributes = !empty($config['allowed_attributes']) ? $config['allowed_attributes'] :
            ['id', 'class', 'name', 'value', 'href', 'src'];

        // Sanitize/clean the HTML.
        $maid = new Maid(
            [
                'output-format'   => 'html',
                'allowed-tags'    => $allowedTags,
                'allowed-attribs' => $allowedAttributes,
            ]
        );
        $output = $maid->clean($output);

        return $output;
    }
public function markdown ( $ content ) { // Parse the field as Markdown, return HTML $ output = $ this -> markdown -> text ( $ content ) ; $ config = $ this -> config -> get ( 'general/htmlcleaner' ) ; $ allowedTags = ! empty ( $ config [ 'allowed_tags' ] ) ? $ config [ 'allowed_tags' ] : [ 'div' , 'p' , 'br' , 'hr' , 's' , 'u' , 'strong' , 'em' , 'i' , 'b' , 'li' , 'ul' , 'ol' , 'blockquote' , 'pre' , 'code' , 'tt' , 'h1' , 'h2' , 'h3' , 'h4' , 'h5' , 'h6' , 'dd' , 'dl' , 'dh' , 'table' , 'tbody' , 'thead' , 'tfoot' , 'th' , 'td' , 'tr' , 'a' , 'img' ] ; $ allowedAttributes = ! empty ( $ config [ 'allowed_attributes' ] ) ? $ config [ 'allowed_attributes' ] : [ 'id' , 'class' , 'name' , 'value' , 'href' , 'src' ] ; // Sanitize/clean the HTML. $ maid = new Maid ( [ 'output-format' => 'html' , 'allowed-tags' => $ allowedTags , 'allowed-attribs' => $ allowedAttributes , ] ) ; $ output = $ maid -> clean ( $ output ) ; return $ output ; }
Formats the given string as Markdown in HTML.

@param string $content

@return string Markdown output
Formats the given string as Markdown in HTML .