]> git.mxchange.org Git - friendica.git/blobdiff - library/markdown.php
Shared posts to Libertree now look better.
[friendica.git] / library / markdown.php
index 61eb5951cff81375a47fc2f6fed4f871ccb38b30..8def53fcbdaba4906f5ea5bf9403a97795079d29 100644 (file)
@@ -14,26 +14,22 @@ use \Michelf\MarkdownExtra;
  *
  * This function is using the php-markdown library by Michel Fortin to parse a 
  * string ($text).It returns the rendered HTML code from that text. The optional 
- * $hardbreak parameter is used to switch between inserting hard breaks after
+ * $hardwrap parameter is used to switch between inserting hard breaks after
  * every linefeed, which is required for Diaspora compatibility, or not. The
  * later is used for parsing documentation and README.md files.
  *
  * @param string $text
- * @param boolean $hardbreak
- * @returns string
+ * @param boolean $hardwrap
+ * @return string
  */
 
-function Markdown($text, $hardbreak=true) {
+function Markdown($text, $hardwrap = true) {
        $a = get_app();
 
        $stamp1 = microtime(true);
 
        $MarkdownParser = new MarkdownExtra();
-       if ($hardbreak) {
-               $MarkdownParser->hard_wrap = true;
-       } else {
-               $MarkdownParser->hard_wrap = false;
-       }
+       $MarkdownParser->hard_wrap = $hardwrap;
        $html = $MarkdownParser->transform($text);
 
        $a->save_timestamp($stamp1, "parser");