friendica/library/markdown.php

25 wiersze
562 B
PHP
Czysty Zwykły widok Historia

2011-04-11 12:59:26 +00:00
<?php
2015-02-23 07:27:35 +00:00
//# Install PSR-0-compatible class autoloader
//spl_autoload_register(function($class){
// require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php';
//});
2011-04-11 12:59:26 +00:00
2015-02-23 07:27:35 +00:00
require_once("library/php-markdown/Michelf/MarkdownExtra.inc.php");
# Get Markdown class
use \Michelf\MarkdownExtra;
2015-02-22 19:06:13 +00:00
2015-02-23 07:27:35 +00:00
function Markdown($text) {
$a = get_app();
$stamp1 = microtime(true);
2015-02-23 07:27:35 +00:00
# Read file and pass content through the Markdown parser
$html = MarkdownExtra::defaultTransform($text);
2015-02-22 19:06:13 +00:00
$a->save_timestamp($stamp1, "rendering");
2015-02-23 07:27:35 +00:00
return $html;
2011-04-11 12:59:26 +00:00
}
?>