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