Ensure markers are checked when beginning blocks

This commit is contained in:
Aidan Woods 2019-02-03 00:20:54 +00:00
parent 08c40afc16
commit d9792bb12c
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
2 changed files with 8 additions and 0 deletions

View File

@ -58,6 +58,10 @@ final class FencedCode implements ContinuableBlock
) {
$marker = \substr($Context->line()->text(), 0, 1);
if ($marker !== '`' && $marker !== '~') {
return null;
}
$openerLength = \strspn($Context->line()->text(), $marker);
if ($openerLength < 3) {

View File

@ -29,6 +29,10 @@ final class Rule implements Block
$marker = \substr($Context->line()->text(), 0, 1);
if ($marker !== '*' && $marker !== '-' && $marker !== '_') {
return null;
}
if (
\substr_count($Context->line()->text(), $marker) >= 3
&& \chop($Context->line()->text(), " \t$marker") === ''