friendica/library/markdown.php

14 wiersze
324 B
PHP
Czysty Zwykły widok Historia

2011-04-11 12:59:26 +00:00
<?php
require_once("library/parsedown/Parsedown.php");
2011-04-11 12:59:26 +00:00
function Markdown($text) {
2015-02-22 19:06:13 +00:00
// 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));
2011-04-11 12:59:26 +00:00
}
?>