All working after I changed the class.format.php file. function safe_html($html, $options=array()) { // Remove HEAD and STYLE sections $html = preg_replace( array(':<(head|style|script).+?</\1>', # <head> and <style> sections ':<!\>:', # <> and friends ':<!DOCTYPE+>:', # <!DOCTYPE ... > ':<\?+>:', # <?xml version="1.0" ... > ':<html*', # Clean html tag (Issue 2272 fix) ), array('', '', '', '', '<html'), $html);