public function markdown($content)
{
// Parse the field as Markdown, return HTML
$output = $this->app['markdown']->text($content);
$config = $this->app['config']->get('general/htmlcleaner');
$allowed_tags = !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'];
$allowed_attributes = !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' => $allowed_tags, 'allowed-attribs' => $allowed_attributes]);
$output = $maid->clean($output);
return $output;
}