1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Implement Comment

This commit is contained in:
Aidan Woods
2019-01-20 02:26:03 +00:00
parent c50deda690
commit 194c916c6a
2 changed files with 89 additions and 40 deletions

View File

@ -334,46 +334,6 @@ class Parsedown
return $Block;
}
#
# Comment
protected function blockComment(Context $Context)
{
if ($this->markupEscaped or $this->safeMode) {
return;
}
if (\strpos($Context->line()->text(), '<!--') === 0) {
$Block = [
'element' => [
'rawHtml' => $Context->line()->rawLine(),
'autobreak' => true,
],
];
if (\strpos($Context->line()->text(), '-->') !== false) {
$Block['closed'] = true;
}
return $Block;
}
}
protected function blockCommentContinue(Context $Context, array $Block)
{
if (isset($Block['closed'])) {
return;
}
$Block['element']['rawHtml'] .= "\n" . $Context->line()->rawLine();
if (\strpos($Context->line()->text(), '-->') !== false) {
$Block['closed'] = true;
}
return $Block;
}
#
# Fenced Code