diff --git a/src/Components/Blocks/Rule.php b/src/Components/Blocks/Rule.php index e846761..a6a88e3 100644 --- a/src/Components/Blocks/Rule.php +++ b/src/Components/Blocks/Rule.php @@ -24,6 +24,10 @@ final class Rule implements Block Block $Block = null, State $State = null ) { + if ($Context->line()->indent() > 3) { + return null; + } + $marker = $Context->line()->text()[0]; if (\substr_count($Context->line()->text(), $marker) >= 3 and \chop($Context->line()->text(), " $marker") === '') { diff --git a/tests/data/horizontal_rule.html b/tests/data/horizontal_rule.html index 68da03d..4d3f44f 100644 --- a/tests/data/horizontal_rule.html +++ b/tests/data/horizontal_rule.html @@ -2,4 +2,6 @@


-
\ No newline at end of file +
+

foo +***

\ No newline at end of file diff --git a/tests/data/horizontal_rule.md b/tests/data/horizontal_rule.md index bf461a9..9a1bb57 100644 --- a/tests/data/horizontal_rule.md +++ b/tests/data/horizontal_rule.md @@ -6,4 +6,7 @@ *** -___ \ No newline at end of file +___ + +foo + *** \ No newline at end of file