]> git.mxchange.org Git - friendica.git/blob - library/markdown.php
Bugfix for spaces in links
[friendica.git] / library / markdown.php
1 <?php
2 require_once("library/parsedown/Parsedown.php");
3
4 function Markdown($text) {
5
6         // Bugfix for the library:
7         // "[Title](http://domain.tld/ )" isn't handled correctly
8         $text = preg_replace("/\[(.*?)\]\s*?\(\s*?(\S*?)\s*?\)/ism", '[$1]($2)', $text);
9
10         $Parsedown = new Parsedown();
11         return($Parsedown->text($text));
12 }
13 ?>