diff --git a/src/Components/Blocks/Rule.php b/src/Components/Blocks/Rule.php new file mode 100644 index 0000000..e846761 --- /dev/null +++ b/src/Components/Blocks/Rule.php @@ -0,0 +1,43 @@ +line()->text()[0]; + + if (\substr_count($Context->line()->text(), $marker) >= 3 and \chop($Context->line()->text(), " $marker") === '') { + return new self; + } + + return null; + } + + /** + * @return Element + */ + public function stateRenderable(Parsedown $_) + { + return Element::selfClosing('hr', []); + } +} diff --git a/src/Parsedown.php b/src/Parsedown.php index 236370a..5352931 100644 --- a/src/Parsedown.php +++ b/src/Parsedown.php @@ -334,24 +334,6 @@ class Parsedown return $Block; } - # - # Rule - - protected function blockRule(Context $Context) - { - $marker = $Context->line()->text()[0]; - - if (\substr_count($Context->line()->text(), $marker) >= 3 and \chop($Context->line()->text(), " $marker") === '') { - $Block = [ - 'element' => [ - 'name' => 'hr', - ], - ]; - - return $Block; - } - } - # # Setext