diff --git a/Parsedown.php b/Parsedown.php index 5ca40d8..0313408 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -383,13 +383,13 @@ class Parsedown return; } - if (isset($Line['text'][3]) and $Line['text'][3] === '-' and $Line['text'][2] === '-' and $Line['text'][1] === '!') + if (strpos($Line['text'], '$/', $Line['text'])) + if (strpos($Line['text'], '-->') !== false) { $Block['closed'] = true; } @@ -407,7 +407,7 @@ class Parsedown $Block['element']['rawHtml'] .= "\n" . $Line['body']; - if (preg_match('/-->$/', $Line['text'])) + if (strpos($Line['text'], '-->') !== false) { $Block['closed'] = true; } diff --git a/test/data/html_comment.html b/test/data/html_comment.html index 566dc3a..009c309 100644 --- a/test/data/html_comment.html +++ b/test/data/html_comment.html @@ -2,4 +2,10 @@

paragraph

-

paragraph

\ No newline at end of file +

paragraph

+abc + \ No newline at end of file diff --git a/test/data/html_comment.md b/test/data/html_comment.md index 6ddfdb4..27aeb29 100644 --- a/test/data/html_comment.md +++ b/test/data/html_comment.md @@ -5,4 +5,10 @@ paragraph -paragraph \ No newline at end of file +paragraph + +abc + +* abcd +* bbbb +* cccc \ No newline at end of file