FIX подготовка чистой версии текста - забыл убрать ссылки

This commit is contained in:
Krivchikov Dmitry 2015-09-11 15:06:22 +03:00
parent 2d1bec229a
commit 2af45127b8
1 changed files with 5 additions and 5 deletions

View File

@ -115,14 +115,14 @@ class Markdown
// \n & \r
$string = str_replace(array("\n","\r",' -- '), array(' ', ' ',' '), $string);
// multi-space
$pr = '(\s{2,})';
// URL
$pr = '((https{0,1}:\/\/[\da-z\.-]+\.[a-z]{2,6})[\/\w\?=&#%+\.,-]*\/?)';
$rep = '';
$string = preg_replace($pr, $rep, $string);
// URL
$pr = '((https{0,1}:\/\/[\da-z\.-]+\.[a-z]{2,6})[\/\w\?=&#%+\.,-]*\/?)';
$rep = '<a href="$0" title="$0" target="_blank">$1</a>';
// multi-space
$pr = '(\s{2,})';
$rep = ' ';
$string = preg_replace($pr, $rep, $string);
return trim($string);