Fix markup again. And add the option to repair fucked up nesting (and more) with HTML Tidy ($config['markup_repair_tidy'])

This commit is contained in:
Michael Foster 2013-08-29 15:56:36 +10:00
parent 3b63cad71f
commit 7b817eea11
2 changed files with 18 additions and 5 deletions

View file

@ -1728,7 +1728,16 @@ function markup(&$body, $track_cites = false) {
$body = preg_replace('/\s+$/', '', $body);
$body = preg_replace("/\n/", '<br/>', $body);
if ($config['markup_repair_tidy']) {
$tidy = new tidy();
$body = $tidy->repairString($body, array(
'doctype' => 'omit'
));
$body = str_replace("\n", '', $body);
$body = preg_replace('@^.+<body>|</body>.+$@', '', $body);
}
return $tracked_cites;
}