4 * @file library/markdown.php
6 * @brief Parser for Markdown files
9 use \Michelf\MarkdownExtra;
12 * @brief This function parses a text using php-markdown library to render Markdown syntax to HTML
14 * This function is using the php-markdown library by Michel Fortin to parse a
15 * string ($text).It returns the rendered HTML code from that text. The optional
16 * $hardwrap parameter is used to switch between inserting hard breaks after
17 * every linefeed, which is required for Diaspora compatibility, or not. The
18 * later is used for parsing documentation and README.md files.
21 * @param boolean $hardwrap
25 function Markdown($text, $hardwrap = true) {
28 $stamp1 = microtime(true);
30 $MarkdownParser = new MarkdownExtra();
31 $MarkdownParser->hard_wrap = $hardwrap;
32 $html = $MarkdownParser->transform($text);
34 $a->save_timestamp($stamp1, "parser");