diff --git a/src/Components/Inlines/HardBreak.php b/src/Components/Inlines/HardBreak.php index f2bb819..ddfaa9e 100644 --- a/src/Components/Inlines/HardBreak.php +++ b/src/Components/Inlines/HardBreak.php @@ -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(); diff --git a/src/Components/Inlines/SoftBreak.php b/src/Components/Inlines/SoftBreak.php index 1def586..11d36f2 100644 --- a/src/Components/Inlines/SoftBreak.php +++ b/src/Components/Inlines/SoftBreak.php @@ -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();