markdown : BUG : Correct the "code" section : don't allow ul/li in codes, print */- normally

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1508 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-06-30 12:11:52 +00:00
parent 9ef7095303
commit 18fe0913ae

View File

@@ -149,6 +149,15 @@ class markdown
$type = $this->paragraphType ($line); $type = $this->paragraphType ($line);
$this->debugMKD ("DEBUT: Type='$type'"); $this->debugMKD ("DEBUT: Type='$type'");
$matches = array (); $matches = array ();
$indent = strspn ($line, " ");
if (end ($typeStack) === "code" && $indent >= end ($indentStack))
{
$this->debugMKD ("DEBUT: Force type=CODE");
$type = "code";
$lineTxt = $line;
}
else
{
switch ($type) switch ($type)
{ {
case "ol" : case "ol" :
@@ -168,8 +177,8 @@ class markdown
default: default:
$lineTxt = $line; $lineTxt = $line;
} }
}
$indent = strspn ($line, " ");
$this->debugMKD ("DEBUT: Indent='$indent'"); $this->debugMKD ("DEBUT: Indent='$indent'");
$this->debugMKD ("DEBUT: indentStack=".print_r ($indentStack, TRUE)); $this->debugMKD ("DEBUT: indentStack=".print_r ($indentStack, TRUE));
$this->debugMKD ("DEBUT: typeStack=".print_r ($typeStack, TRUE)); $this->debugMKD ("DEBUT: typeStack=".print_r ($typeStack, TRUE));