From 532b5ede354a9deb9c7a40fc90af137157971e33 Mon Sep 17 00:00:00 2001 From: Emanuil Rusev Date: Wed, 14 May 2014 01:11:05 +0300 Subject: [PATCH] resolve #129 --- Parsedown.php | 7 +++---- test/data/block-level_html.html | 5 ++++- test/data/block-level_html.md | 6 +++++- 3 files changed, 12 insertions(+), 6 deletions(-) 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'] = ''; + $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'], '') !== 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 @@
_content_

sparse:

+
_content_ -
\ No newline at end of file +
+ +

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:
+
_content_ -
\ No newline at end of file +
+ + +paragraph \ No newline at end of file