diff --git a/markdown.php b/markdown.php index ea9abda..8e00b9e 100644 --- a/markdown.php +++ b/markdown.php @@ -36,7 +36,7 @@ class markdown // SEPARATORS : *** --- ___ * * * - - - _ _ _ // Must be placed before EMPHASIS $search[] = "/^[*_-] ?[*_-] ?[*_-]$/Um"; - $replace[] = "

\n
\n

"; + $replace[] = "\n


\n"; $mark = preg_replace ($search, $replace, $mark); @@ -44,6 +44,7 @@ class markdown $res = $this->paragraph ($mark); $res = str_replace ("

", "", $res); + $res = str_replace ("

\n

", "", $res); return $res; } @@ -187,14 +188,14 @@ class markdown if ($oldType === "code") { $this->debugMKD (""); - $res .= "\n"; + $res .= ""; array_pop ($htmlStack); array_pop ($indentStack); } else { $this->debugMKD (str_repeat (" ", end ($indentStack)).""); - $res .= str_repeat (" ", end ($indentStack))."\n"; + $res .= str_repeat (" ", end ($indentStack)).""; } array_pop ($indentStack); array_pop ($htmlStack); @@ -232,7 +233,7 @@ class markdown if (end ($typeStack) !== FALSE) { // Remove last \n to put closing tag at the end of line - $res = substr ($res, 0, -1); + //$res = substr ($res, 0, -1); $oldType = array_pop ($typeStack); $this->debugMKD (str_repeat (" ", end ($indentStack)).""); $res .= str_repeat (" ", end ($indentStack))."";