2011-04-11 14:59:26 +02:00
|
|
|
<?php
|
2015-02-22 17:38:28 +01:00
|
|
|
require_once("library/parsedown/Parsedown.php");
|
2011-04-11 14:59:26 +02:00
|
|
|
|
|
|
|
function Markdown($text) {
|
2015-02-22 20:06:13 +01:00
|
|
|
|
|
|
|
// Bugfix for the library:
|
|
|
|
// "[Title](http://domain.tld/ )" isn't handled correctly
|
|
|
|
$text = preg_replace("/\[(.*?)\]\s*?\(\s*?(\S*?)\s*?\)/ism", '[$1]($2)', $text);
|
|
|
|
|
2015-02-22 17:38:28 +01:00
|
|
|
$Parsedown = new Parsedown();
|
|
|
|
return($Parsedown->text($text));
|
2011-04-11 14:59:26 +02:00
|
|
|
}
|
2015-02-22 17:38:28 +01:00
|
|
|
?>
|