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

Implement SetextHeader

This commit is contained in:
Aidan Woods
2019-01-20 02:28:35 +00:00
parent af97e99b39
commit edc004f503
2 changed files with 74 additions and 16 deletions

View File

@ -334,22 +334,6 @@ class Parsedown
return $Block;
}
#
# Setext
protected function blockSetextHeader(Context $Context, array $Block = null)
{
if (! isset($Block) or $Block['type'] !== 'Paragraph' or $Context->previousEmptyLines() > 0) {
return;
}
if ($Context->line()->indent() < 4 and \chop(\chop($Context->line()->text(), " \t"), $Context->line()->text()[0]) === '') {
$Block['element']['name'] = $Context->line()->text()[0] === '=' ? 'h1' : 'h2';
return $Block;
}
}
#
# Markup