diff --git a/Tests/markdownTest.php b/Tests/markdownTest.php index 173daf9..849159b 100644 --- a/Tests/markdownTest.php +++ b/Tests/markdownTest.php @@ -306,6 +306,24 @@ base"); printf ($md->html (" \n * OK")); } + public function testChainCode2 () + { + $this->expectOutputString("
+* * * * * www-data OK");
+ $md = new markdown ();
+ printf ($md->html (" \n * * * * * www-data OK"));
+ }
+
+ public function testChainCode3 ()
+ {
+ $this->expectOutputString("To write
+* * * * * www-data OK");
+ $md = new markdown ();
+ printf ($md->html ("To write
+
+ * * * * * www-data OK"));
+ }
+
public function testUnnumberredAndText1 ()
{
$this->expectOutputString("Hi
diff --git a/markdown.php b/markdown.php index 4fea25d..85d1a47 100644 --- a/markdown.php +++ b/markdown.php @@ -288,7 +288,15 @@ class markdown // detect the type and call the right type function while (isset ($text[$pos])) { - if ($this->depth ($text[$pos]) > $depth) + if ($this->depth ($text[$pos]) > $depth && $depth === 0) + { + // New block code + if ($this->debug) + echo "New block code\n"; + $content .= $this->typeCode ($text, $this->depth ($text[$pos]), $pos); + continue; + } + elseif ($this->depth ($text[$pos]) > $depth) { if ($this->debug) echo "CALL DEPTH > MINDEPTH (".$this->depth ($text[$pos]).