friendica/library/markdown.php
2015-02-22 20:06:13 +01:00

14 lines
324 B
PHP

<?php
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));
}
?>