diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-29 21:05:03 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-29 21:05:03 +1000 |
| commit | 471525a58bc59399066eaffb6e593b432ec854a8 (patch) | |
| tree | b0e0f32391ba253b8a09b7c62f8dbb3ef300930d | |
| parent | 8144e517e9f3913ef024a45d702f0185a825df39 (diff) | |
HTML Tidy fixes: UTF-8, preserving whitespace, keep attributes literal, don't wrap text
| -rw-r--r-- | inc/functions.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/inc/functions.php b/inc/functions.php index f99713f7..22a6d9ff 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1731,16 +1731,22 @@ 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 = $tidy->repairString(str_replace(' ', ' ', $body), array( + 'doctype' => 'omit', + 'bare' => true, + 'literal-attributes' => true, + 'quote-nbsp' => true, + 'indent' => false, + 'show-body-only' => true, + 'wrap' => 0, + 'output-bom' => false, + ), 'utf8'); $body = str_replace("\n", '', $body); - $body = preg_replace('@^.+<body>|</body>.+$@', '', $body); } - + return $tracked_cites; } |
