Commit 2da10d27 authored by Emanuil Rusev's avatar Emanuil Rusev
Browse files

resolve #105

parent 532b5ede
......@@ -87,7 +87,7 @@ class Parsedown
'8' => array('List'),
'9' => array('List'),
':' => array('Table'),
'<' => array('Markup'),
'<' => array('Comment', 'Markup'),
'=' => array('Setext'),
'>' => array('Quote'),
'_' => array('Rule'),
......@@ -346,6 +346,43 @@ class Parsedown
return $Block;
}
#
# Comment
protected function identifyComment($Line)
{
if (isset($Line['text'][3]) and $Line['text'][3] === '-' and $Line['text'][2] === '-' and $Line['text'][1] === '!')
{
$Block = array(
'element' => $Line['body'],
);
if (preg_match('/-->$/', $Line['text']))
{
$Block['closed'] = true;
}
return $Block;
}
}
protected function addToComment($Line, array $Block)
{
if (isset($Block['closed']))
{
return;
}
$Block['element'] .= "\n" . $Line['body'];
if (preg_match('/-->$/', $Line['text']))
{
$Block['closed'] = true;
}
return $Block;
}
#
# Fenced Code
......
<!-- single line -->
<p>paragraph</p>
<!--
multiline -->
<p>paragraph</p>
\ No newline at end of file
<!-- single line -->
paragraph
<!--
multiline -->
paragraph
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment