mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Assert marker is correct for hard and soft breaks
This commit is contained in:
parent
369aea5d8d
commit
3bb24c20a6
@ -33,6 +33,12 @@ final class HardBreak implements Inline
|
||||
*/
|
||||
public static function build(Excerpt $Excerpt, State $State)
|
||||
{
|
||||
$marker = \substr($Excerpt->text(), 0, 1);
|
||||
|
||||
if ($marker !== "\n") {
|
||||
return null;
|
||||
}
|
||||
|
||||
$context = $Excerpt->context();
|
||||
$offset = $Excerpt->offset();
|
||||
|
||||
|
@ -36,6 +36,12 @@ final class SoftBreak implements Inline
|
||||
*/
|
||||
public static function build(Excerpt $Excerpt, State $State)
|
||||
{
|
||||
$marker = \substr($Excerpt->text(), 0, 1);
|
||||
|
||||
if ($marker !== "\n") {
|
||||
return null;
|
||||
}
|
||||
|
||||
$context = $Excerpt->context();
|
||||
$offset = $Excerpt->offset();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user