From 44463102b92e2c79a4e98b11a0635a1da98b0108 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Tue, 19 Dec 2023 01:38:13 +0100 Subject: [PATCH] Improve Markdown description formatting --- src/Markdown/TypeBuilder.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Markdown/TypeBuilder.php b/src/Markdown/TypeBuilder.php index ca45b69..a8deabc 100644 --- a/src/Markdown/TypeBuilder.php +++ b/src/Markdown/TypeBuilder.php @@ -472,7 +472,14 @@ public function tableOfContents() private function description(Schema $schema) { - $res = str_replace("\n", " ", $schema->title . $schema->description); + $res = str_replace("\n", " ", trim($schema->title)); + if (trim($schema->description)) { + if ($res) { + $res .= ". "; + } + + $res .= str_replace("\n", " ", trim($schema->description)); + } if ($res) { return rtrim($res, '.') . '.'; }