From 5a0171caa74a8182ef7b2ad1326f0f4c41799290 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Sat, 10 May 2014 22:07:30 +0000 Subject: [PATCH] Adding more logs at the start of the script to help the debug git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1286 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- markdown.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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") {