Thematic breaks can't have an indent of more than 3

This commit is contained in:
Aidan Woods 2019-01-22 19:23:05 +00:00
parent 96d8a1f18c
commit 4e9a0113c3
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
3 changed files with 11 additions and 2 deletions

View File

@ -24,6 +24,10 @@ final class Rule implements Block
Block $Block = null, Block $Block = null,
State $State = null State $State = null
) { ) {
if ($Context->line()->indent() > 3) {
return null;
}
$marker = $Context->line()->text()[0]; $marker = $Context->line()->text()[0];
if (\substr_count($Context->line()->text(), $marker) >= 3 and \chop($Context->line()->text(), " $marker") === '') { if (\substr_count($Context->line()->text(), $marker) >= 3 and \chop($Context->line()->text(), " $marker") === '') {

View File

@ -2,4 +2,6 @@
<hr /> <hr />
<hr /> <hr />
<hr /> <hr />
<hr /> <hr />
<p>foo
***</p>

View File

@ -6,4 +6,7 @@
*** ***
___ ___
foo
***