]> git.mxchange.org Git - friendica.git/blobdiff - library/markdown.php
FR update to the strings THX Perig
[friendica.git] / library / markdown.php
index 271d2e36c68a411442ef686530146e34d0662062..a8152c2ab61929b8e6b75fb45adf14ee0839991b 100644 (file)
@@ -1,8 +1,24 @@
 <?php
-require_once("library/parsedown/Parsedown.php");
+//# Install PSR-0-compatible class autoloader
+//spl_autoload_register(function($class){
+//     require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php';
+//});
+
+require_once("library/php-markdown/Michelf/MarkdownExtra.inc.php");
+# Get Markdown class
+use \Michelf\MarkdownExtra;
 
 function Markdown($text) {
-       $Parsedown = new Parsedown();
-       return($Parsedown->text($text));
+
+       $a = get_app();
+
+       $stamp1 = microtime(true);
+
+       # Read file and pass content through the Markdown parser
+       $html = MarkdownExtra::defaultTransform($text);
+
+       $a->save_timestamp($stamp1, "parser");
+
+       return $html;
 }
 ?>