diff --git a/markdown.php b/markdown.php index c69724a..32e0b1b 100644 --- a/markdown.php +++ b/markdown.php @@ -5,7 +5,7 @@ function debugMKD ($msg) { - return; + //return; $trace = debug_backtrace(); $back = reset ($trace); file_put_contents ("/tmp/debug", "[".$back["line"]."] $msg\n", FILE_APPEND); @@ -158,6 +158,8 @@ $timeStart = microtime (TRUE); $indent = strspn ($line, " "); debugMKD ("DEBUT: Indent='$indent'"); + debugMKD ("DEBUT: indentStack=".print_r ($indentStack, TRUE)); + debugMKD ("DEBUT: typeStack=".print_r ($typeStack, TRUE)); // Spacing if ($indent < end ($indentStack)) @@ -294,6 +296,15 @@ $timeStart = microtime (TRUE); array_pop ($htmlStack); } + // New paragraphs +/* if ($type === "p") + { + debugMKD ("DEB1 : Starting a new paragraph"); + debugMKD (str_repeat (" ", $indent)."<$type>"); + $res .= "\n".str_repeat (" ", $indent)."<$type>"; + array_push ($typeStack, $type); + }*/ + // If code, there is no emphasis, email, and other convertions if ($type !== "code") {