diff --git a/Parsedown.php b/Parsedown.php index f27b068..05069af 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -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) { diff --git a/test/data/block-level_html.html b/test/data/block-level_html.html index c4ccf54..ef6ecc0 100644 --- a/test/data/block-level_html.html +++ b/test/data/block-level_html.html @@ -1,5 +1,8 @@
sparse:
paragraph
\ No newline at end of file diff --git a/test/data/block-level_html.md b/test/data/block-level_html.md index 40ba893..943e183 100644 --- a/test/data/block-level_html.md +++ b/test/data/block-level_html.md @@ -3,5 +3,9 @@ sparse: