1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00
This commit is contained in:
Emanuil Rusev 2014-05-14 01:11:05 +03:00
parent 2bd2f81f4f
commit 532b5ede35
3 changed files with 12 additions and 6 deletions

View File

@ -601,8 +601,7 @@ class Parsedown
else
{
$Block['depth'] = 0;
$Block['start'] = '<'.$matches[1].'>';
$Block['end'] = '</'.$matches[1].'>';
$Block['name'] = $matches[1];
}
return $Block;
@ -616,12 +615,12 @@ class Parsedown
return;
}
if (stripos($Line['text'], $Block['start']) !== false) # opening tag
if (preg_match('/<'.$Block['name'].'([ ][^\/]+)?>/', $Line['text'])) # opening tag
{
$Block['depth'] ++;
}
if (stripos($Line['text'], $Block['end']) !== false) # closing tag
if (stripos($Line['text'], '</'.$Block['name'].'>') !== false) # closing tag
{
if ($Block['depth'] > 0)
{

View File

@ -1,5 +1,8 @@
<div>_content_</div>
<p>sparse:</p>
<div>
<div class="inner">
_content_
</div>
</div>
</div>
<p>paragraph</p>

View File

@ -3,5 +3,9 @@
sparse:
<div>
<div class="inner">
_content_
</div>
</div>
</div>
paragraph