mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
We don't need to pass a Parsedown instance down
Since Parsedown is instancible from State, we only need to carry that down.
This commit is contained in:
@@ -76,15 +76,15 @@ final class Header implements Block
|
||||
/**
|
||||
* @return Handler<Element>
|
||||
*/
|
||||
public function stateRenderable(Parsedown $Parsedown)
|
||||
public function stateRenderable()
|
||||
{
|
||||
return new Handler(
|
||||
/** @return Element */
|
||||
function (State $State) use ($Parsedown) {
|
||||
function (State $State) {
|
||||
return new Element(
|
||||
'h' . \strval($this->level),
|
||||
[],
|
||||
$State->applyTo($Parsedown->line($this->text))
|
||||
$State->applyTo((new Parsedown($State))->line($this->text))
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user