diff options
-rw-r--r-- | inc/functions.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/inc/functions.php b/inc/functions.php index 7db9e909..c2a149c6 100644 --- a/inc/functions.php +++ b/inc/functions.php | |||
@@ -127,6 +127,12 @@ function prepare_url($url) | |||
127 | $html = Encoding::toUTF8(get_external_file($url,15)); | 127 | $html = Encoding::toUTF8(get_external_file($url,15)); |
128 | } | 128 | } |
129 | 129 | ||
130 | if (function_exists('tidy_parse_string')) { | ||
131 | $tidy = tidy_parse_string($html, array(), 'UTF8'); | ||
132 | $tidy->cleanRepair(); | ||
133 | $html = $tidy->value; | ||
134 | } | ||
135 | |||
130 | if (isset($html) and strlen($html) > 0) | 136 | if (isset($html) and strlen($html) > 0) |
131 | { | 137 | { |
132 | $r = new Readability($html, $url); | 138 | $r = new Readability($html, $url); |
@@ -279,7 +285,13 @@ function display_view($view, $id = 0, $full_head = 'yes') | |||
279 | $tpl->assign('id', $entry['id']); | 285 | $tpl->assign('id', $entry['id']); |
280 | $tpl->assign('url', $entry['url']); | 286 | $tpl->assign('url', $entry['url']); |
281 | $tpl->assign('title', $entry['title']); | 287 | $tpl->assign('title', $entry['title']); |
282 | $tpl->assign('content', $entry['content']); | 288 | $content = $entry['content']; |
289 | if (function_exists('tidy_parse_string')) { | ||
290 | $tidy = tidy_parse_string($content, array('indent'=>true, 'show-body-only' => true), 'UTF8'); | ||
291 | $tidy->cleanRepair(); | ||
292 | $content = $tidy->value; | ||
293 | } | ||
294 | $tpl->assign('content', $content); | ||
283 | $tpl->assign('is_fav', $entry['is_fav']); | 295 | $tpl->assign('is_fav', $entry['is_fav']); |
284 | $tpl->assign('is_read', $entry['is_read']); | 296 | $tpl->assign('is_read', $entry['is_read']); |
285 | $tpl->assign('load_all_js', 0); | 297 | $tpl->assign('load_all_js', 0); |