resolve #129
This commit is contained in:
parent
2bd2f81f4f
commit
532b5ede35
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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>
|
|
@ -3,5 +3,9 @@
|
||||||
sparse:
|
sparse:
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
<div class="inner">
|
||||||
_content_
|
_content_
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
paragraph
|
Loading…
Reference in New Issue