mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Require State to build and advance blocks
This commit is contained in:
@@ -31,21 +31,19 @@ final class Header implements Block
|
||||
|
||||
/**
|
||||
* @param Context $Context
|
||||
* @param State $State
|
||||
* @param Block|null $Block
|
||||
* @param State|null $State
|
||||
* @return static|null
|
||||
*/
|
||||
public static function build(
|
||||
Context $Context,
|
||||
Block $Block = null,
|
||||
State $State = null
|
||||
State $State,
|
||||
Block $Block = null
|
||||
) {
|
||||
if ($Context->line()->indent() > 3) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$State = $State ?: new State;
|
||||
|
||||
$level = \strspn($Context->line()->text(), '#');
|
||||
|
||||
if ($level > 6 || $level < 1) {
|
||||
|
||||
Reference in New Issue
Block a user