mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Implement Comment
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user