diff --git a/Parsedown.php b/Parsedown.php index 4a85820..28fab36 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -359,6 +359,11 @@ class Parsedown protected function identifyComment($Line) { + if ($this->markupEscaped) + { + return; + } + if (isset($Line['text'][3]) and $Line['text'][3] === '-' and $Line['text'][2] === '-' and $Line['text'][1] === '!') { $Block = array( diff --git a/test/ParsedownTest.php b/test/ParsedownTest.php index 3763372..d094f2d 100644 --- a/test/ParsedownTest.php +++ b/test/ParsedownTest.php @@ -109,6 +109,10 @@ paragraph color: red; } + +comment + + MARKDOWN_WITH_MARKUP; $expectedHtml = <<

</style>

+

comment

+

<!-- html comment -->

EXPECTED_HTML; $parsedownWithNoMarkup = new Parsedown(); $parsedownWithNoMarkup->setMarkupEscaped(true);