* BUG markdown : Example of cron configuration
* * * * * www-data /usr/share with 4 beginning spaces is not OK (remove
all the stars and put a bullet)
The lists (numbered or not) must start on first char
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2646 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -306,6 +306,24 @@ base</code></pre>");
|
|||||||
printf ($md->html (" \n * OK"));
|
printf ($md->html (" \n * OK"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testChainCode2 ()
|
||||||
|
{
|
||||||
|
$this->expectOutputString("<pre><code>
|
||||||
|
* * * * * www-data OK</code></pre>");
|
||||||
|
$md = new markdown ();
|
||||||
|
printf ($md->html (" \n * * * * * www-data OK"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testChainCode3 ()
|
||||||
|
{
|
||||||
|
$this->expectOutputString("<p>To write</p>
|
||||||
|
<pre><code>* * * * * www-data OK</code></pre>");
|
||||||
|
$md = new markdown ();
|
||||||
|
printf ($md->html ("To write
|
||||||
|
|
||||||
|
* * * * * www-data OK"));
|
||||||
|
}
|
||||||
|
|
||||||
public function testUnnumberredAndText1 ()
|
public function testUnnumberredAndText1 ()
|
||||||
{
|
{
|
||||||
$this->expectOutputString("<p>Hi</p>
|
$this->expectOutputString("<p>Hi</p>
|
||||||
|
|||||||
10
markdown.php
10
markdown.php
@@ -288,7 +288,15 @@ class markdown
|
|||||||
// detect the type and call the right type function
|
// detect the type and call the right type function
|
||||||
while (isset ($text[$pos]))
|
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)
|
if ($this->debug)
|
||||||
echo "CALL DEPTH > MINDEPTH (".$this->depth ($text[$pos]).
|
echo "CALL DEPTH > MINDEPTH (".$this->depth ($text[$pos]).
|
||||||
|
|||||||
Reference in New Issue
Block a user