From d70207fdbbaf916ca066cdbb9b495ac23ecb9b6d Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 25 Apr 2024 15:41:33 +0200 Subject: [PATCH] Trim text before parsing markdown --- src/Entities.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entities.php b/src/Entities.php index 00f8ac6..c5ba5db 100644 --- a/src/Entities.php +++ b/src/Entities.php @@ -70,7 +70,7 @@ final class Entities */ public static function fromMarkdown(string $markdown): self { - $markdown = \str_replace("\r\n", "\n", $markdown); + $markdown = \trim(\str_replace("\r\n", "\n", $markdown)); $message = ''; $messageLen = 0; $entities = [];