mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Fix up unit tests following previous commit
This commit is contained in:
parent
7ead769742
commit
cd6912dfb3
@ -554,13 +554,17 @@ class Parsedown
|
||||
|
||||
$text = trim($text, ' ');
|
||||
$link = strtolower(str_replace(' ','-',$text));
|
||||
$attr = array();
|
||||
if (!empty($link)) {
|
||||
$attr = array(
|
||||
'id' => $link,
|
||||
);
|
||||
}
|
||||
|
||||
$Block = array(
|
||||
'element' => array(
|
||||
'name' => 'h' . $level,
|
||||
'attributes' => array(
|
||||
'id' => $link,
|
||||
),
|
||||
'attributes' => $attr,
|
||||
'handler' => array(
|
||||
'function' => 'lineElements',
|
||||
'argument' => $text,
|
||||
|
@ -54,8 +54,10 @@ class ParsedownTest extends TestCase
|
||||
$this->Parsedown->setStrictMode(substr($test, 0, 6) === 'strict');
|
||||
|
||||
$actualMarkup = $this->Parsedown->text($markdown);
|
||||
$actualMarkup = str_replace("\r\n", "\n", $actualMarkup);
|
||||
$actualMarkup = str_replace("\r", "\n", $actualMarkup);
|
||||
|
||||
$this->assertEquals($expectedMarkup, $actualMarkup);
|
||||
$this->assertEquals(trim($expectedMarkup), trim($actualMarkup));
|
||||
}
|
||||
|
||||
function testRawHtml()
|
||||
|
@ -1,13 +1,13 @@
|
||||
<h1>h1</h1>
|
||||
<h2>h2</h2>
|
||||
<h3>h3</h3>
|
||||
<h4>h4</h4>
|
||||
<h5>h5</h5>
|
||||
<h6>h6</h6>
|
||||
<p>####### not a heading</p>
|
||||
<h1>closed h1</h1>
|
||||
<h1></h1>
|
||||
<h2></h2>
|
||||
<h1># of levels</h1>
|
||||
<h1># of levels #</h1>
|
||||
<h1>heading</h1>
|
||||
<h1 id="h1">h1</h1>
|
||||
<h2 id="h2">h2</h2>
|
||||
<h3 id="h3">h3</h3>
|
||||
<h4 id="h4">h4</h4>
|
||||
<h5 id="h5">h5</h5>
|
||||
<h6 id="h6">h6</h6>
|
||||
<p>####### not a heading</p>
|
||||
<h1 id="closed-h1">closed h1</h1>
|
||||
<h1></h1>
|
||||
<h2></h2>
|
||||
<h1 id="#-of-levels"># of levels</h1>
|
||||
<h1 id="#-of-levels-#"># of levels #</h1>
|
||||
<h1 id="heading">heading</h1>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<h1>h1</h1>
|
||||
<h2>h2</h2>
|
||||
<h3>h3</h3>
|
||||
<h4>h4</h4>
|
||||
<h5>h5</h5>
|
||||
<h6>h6</h6>
|
||||
<h1 id="h1">h1</h1>
|
||||
<h2 id="h2">h2</h2>
|
||||
<h3 id="h3">h3</h3>
|
||||
<h4 id="h4">h4</h4>
|
||||
<h5 id="h5">h5</h5>
|
||||
<h6 id="h6">h6</h6>
|
||||
<p>####### not a heading</p>
|
||||
<p>#not a heading</p>
|
||||
<h1>closed h1</h1>
|
||||
<h1 id="closed-h1">closed h1</h1>
|
||||
<h1></h1>
|
||||
<h2></h2>
|
||||
<h1># of levels</h1>
|
||||
<h1># of levels #</h1>
|
||||
<h1 id="#-of-levels"># of levels</h1>
|
||||
<h1 id="#-of-levels-#"># of levels #</h1>
|
||||
|
Loading…
Reference in New Issue
Block a user