mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Implement Header
This commit is contained in:
@ -334,39 +334,6 @@ class Parsedown
|
||||
return $Block;
|
||||
}
|
||||
|
||||
#
|
||||
# Header
|
||||
|
||||
protected function blockHeader(Context $Context)
|
||||
{
|
||||
$level = \strspn($Context->line()->text(), '#');
|
||||
|
||||
if ($level > 6) {
|
||||
return;
|
||||
}
|
||||
|
||||
$text = \trim($Context->line()->text(), '#');
|
||||
|
||||
if ($this->strictMode and isset($text[0]) and $text[0] !== ' ') {
|
||||
return;
|
||||
}
|
||||
|
||||
$text = \trim($text, ' ');
|
||||
|
||||
$Block = [
|
||||
'element' => [
|
||||
'name' => 'h' . $level,
|
||||
'handler' => [
|
||||
'function' => 'lineElements',
|
||||
'argument' => $text,
|
||||
'destination' => 'elements',
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
return $Block;
|
||||
}
|
||||
|
||||
#
|
||||
# List
|
||||
|
||||
|
Reference in New Issue
Block a user