From 6ae0a3dd3e1d7ec19d8488ef376d9f192bcc5b08 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 19 Mar 2019 20:41:38 +0300 Subject: share: further improve og:description excerpt logic, minor layout stuff --- classes/handler/public.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'classes/handler/public.php') diff --git a/classes/handler/public.php b/classes/handler/public.php index 15d150619..f73427cbf 100755 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -388,26 +388,29 @@ class Handler_Public extends Handler { $rv .= " - + ".$line["title"]."". stylesheet_tag("css/default.css")." - - "; + + "; - $rv .= "\n"; - //$rv .= "\n"; - $rv .= "\n"; + $rv .= "\n"; + truncate_string( + preg_replace("/[\r\n\t]/", "", + preg_replace("/ {1,}/", " ", + strip_tags(html_entity_decode($line["content"], ENT_NOQUOTES | ENT_HTML401)) + ) + ), 500, "...") + )."\"/>\n"; $rv .= ""; $og_image = $this->get_article_image($enclosures, $line['content'], $line["site_url"]); if ($og_image) { - $rv .= ""; + $rv .= ""; } $rv .= ""; @@ -442,7 +445,7 @@ class Handler_Public extends Handler { /* content */ $lang = $line['lang'] ? $line['lang'] : "en"; - $rv .= "
"; + $rv .= "
"; /* content body */ -- cgit v1.2.3