friendica/library/markdown.php

18 lines
355 B
PHP
Raw Normal View History

2011-04-11 14:59:26 +02:00
<?php
require_once "library/php-markdown/Michelf/MarkdownExtra.inc.php";
2015-02-23 08:27:35 +01:00
use \Michelf\MarkdownExtra;
2015-02-22 20:06:13 +01:00
2015-02-23 08:27:35 +01:00
function Markdown($text) {
$a = get_app();
$stamp1 = microtime(true);
$MarkdownParser = new MarkdownExtra();
$MarkdownParser->hard_wrap = true;
$html = $MarkdownParser->transform($text);
2015-02-22 20:06:13 +01:00
$a->save_timestamp($stamp1, "parser");
2015-02-23 08:27:35 +01:00
return $html;
2011-04-11 14:59:26 +02:00
}