mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Ensure markers are checked when beginning blocks
This commit is contained in:
parent
08c40afc16
commit
d9792bb12c
@ -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) {
|
||||
|
@ -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") === ''
|
||||
|
Loading…
Reference in New Issue
Block a user