diff --git a/ground/classes/Helper.php b/ground/classes/Helper.php index 7d4c896..abe474f 100644 --- a/ground/classes/Helper.php +++ b/ground/classes/Helper.php @@ -114,7 +114,7 @@ class Helper $og = array(); $og['title'] = str_replace('"', 'ʺ', $point->name) . ' [wikipoints.ru]'; $point->description = str_replace('"', 'ʺ', $point->description); - $og['description'] = mb_substr($point->description, 0, 97, 'UTF-8') . '...'; + $og['description'] = mb_substr($point->description, 0, 99, 'UTF-8') . '…'; $og['site_name'] = 'WikiPoints: Лучшие выходные - это выходные в путешествии!'; $og['type'] = 'website'; $og['url'] = 'http://wikipoints.ru/?point=' . $point->id; @@ -128,7 +128,7 @@ class Helper $og = array(); $og['title'] = str_replace('"', 'ʺ', $article->title) . ' [wikipoints.ru]'; $article->text = Markdown::getClear(str_replace('"', 'ʺ', $article->text)); - $og['description'] = mb_substr($article->text, 0, 97, 'UTF-8') . '...'; + $og['description'] = mb_substr($article->text, 0, 99, 'UTF-8') . '…'; $og['site_name'] = 'WikiPoints: Лучшие выходные - это выходные в путешествии!'; $og['type'] = 'website'; $og['url'] = 'http://wikipoints.ru/page/article/id/' . $article->id; diff --git a/ground/classes/Markdown.php b/ground/classes/Markdown.php index 767ef9a..aa4cff1 100644 --- a/ground/classes/Markdown.php +++ b/ground/classes/Markdown.php @@ -120,6 +120,11 @@ class Markdown $rep = ''; $string = preg_replace($pr, $rep, $string); + // Points + $pr = '((\[#(\d+)[>\|](.*?)\])|(\[#(\d+)\]))'; + $rep = ' '; + $string = preg_replace($pr, $rep, $string); + // multi-space $pr = '(\s{2,})'; $rep = ' ';