diff --git a/ground/classes/Markdown.php b/ground/classes/Markdown.php index 2a6798e..767ef9a 100644 --- a/ground/classes/Markdown.php +++ b/ground/classes/Markdown.php @@ -115,16 +115,16 @@ class Markdown // \n & \r $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 $pr = '(\s{2,})'; $rep = ' '; $string = preg_replace($pr, $rep, $string); - // URL - $pr = '((https{0,1}:\/\/[\da-z\.-]+\.[a-z]{2,6})[\/\w\?=&#%+\.,-]*\/?)'; - $rep = '$1'; - $string = preg_replace($pr, $rep, $string); - return trim($string); }