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

View File

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

View File

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