]> git.mxchange.org Git - friendica.git/blobdiff - library/markdown.php
Bugfix for spaces in links
[friendica.git] / library / markdown.php
index 271d2e36c68a411442ef686530146e34d0662062..83082f7ca77072a4eee47ef82bca1ccba814c1a8 100644 (file)
@@ -2,6 +2,11 @@
 require_once("library/parsedown/Parsedown.php");
 
 function Markdown($text) {
+
+       // Bugfix for the library:
+       // "[Title](http://domain.tld/ )" isn't handled correctly
+       $text = preg_replace("/\[(.*?)\]\s*?\(\s*?(\S*?)\s*?\)/ism", '[$1]($2)', $text);
+
        $Parsedown = new Parsedown();
        return($Parsedown->text($text));
 }