mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Merge pull request #236 from naNuke/escapeComment
Ignore html comments as well with markupEscape option.
This commit is contained in:
commit
2adb87ef41
@ -359,6 +359,11 @@ class Parsedown
|
|||||||
|
|
||||||
protected function identifyComment($Line)
|
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] === '!')
|
if (isset($Line['text'][3]) and $Line['text'][3] === '-' and $Line['text'][2] === '-' and $Line['text'][1] === '!')
|
||||||
{
|
{
|
||||||
$Block = array(
|
$Block = array(
|
||||||
|
@ -109,6 +109,10 @@ paragraph
|
|||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
comment
|
||||||
|
|
||||||
|
<!-- html comment -->
|
||||||
MARKDOWN_WITH_MARKUP;
|
MARKDOWN_WITH_MARKUP;
|
||||||
|
|
||||||
$expectedHtml = <<<EXPECTED_HTML
|
$expectedHtml = <<<EXPECTED_HTML
|
||||||
@ -125,6 +129,8 @@ MARKDOWN_WITH_MARKUP;
|
|||||||
color: red;
|
color: red;
|
||||||
}</code></pre>
|
}</code></pre>
|
||||||
<p></style></p>
|
<p></style></p>
|
||||||
|
<p>comment</p>
|
||||||
|
<p><!-- html comment --></p>
|
||||||
EXPECTED_HTML;
|
EXPECTED_HTML;
|
||||||
$parsedownWithNoMarkup = new Parsedown();
|
$parsedownWithNoMarkup = new Parsedown();
|
||||||
$parsedownWithNoMarkup->setMarkupEscaped(true);
|
$parsedownWithNoMarkup->setMarkupEscaped(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user