mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
resolve #129
This commit is contained in:
parent
2bd2f81f4f
commit
532b5ede35
@ -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)
|
||||
{
|
||||
|
@ -1,5 +1,8 @@
|
||||
<div>_content_</div>
|
||||
<p>sparse:</p>
|
||||
<div>
|
||||
<div class="inner">
|
||||
_content_
|
||||
</div>
|
||||
</div>
|
||||
<p>paragraph</p>
|
@ -3,5 +3,9 @@
|
||||
sparse:
|
||||
|
||||
<div>
|
||||
<div class="inner">
|
||||
_content_
|
||||
</div>
|
||||
</div>
|
||||
|
||||
paragraph
|
Loading…
Reference in New Issue
Block a user