markdown allow a good indentation in ul/li.

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1511 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-07-01 12:27:50 +00:00
parent 386f490481
commit 87cb2d4fcf
2 changed files with 58 additions and 2 deletions

View File

@@ -195,6 +195,12 @@ class markdown
$res .= "</li>\n";
array_pop ($htmlStack);
}
if (strlen ($res) && in_array ($type, array ("ul","ol","p")))
{
$this->debugMKD ("Add \\n because of new block and not at start");
$res .= "\n";
}
// Remove last \n to put closing tag at the end of line
$res = substr ($res, 0, -1);
@@ -245,7 +251,7 @@ class markdown
{
$this->debugMKD ("DEB2 : Continuous LI block");
// Suppress \n on last line
$res = substr ($res, 0, -1);
// $res = substr ($res, 0, -1);
$type = prev ($htmlStack);
$blockLI = true;
$lineTxt = " ".$lineTxt;
@@ -296,6 +302,12 @@ class markdown
continue;
}
if (strlen ($res) && in_array ($type, array ("ul","ol","p")))
{
$this->debugMKD ("Add \\n because of new block");
$res .= "\n";
}
if (end ($indentStack))
array_pop ($indentStack);
if ($type === "code")