From 67e6392dd28fe372d3d89c00ab27cae54733add5 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Fri, 26 Apr 2019 16:30:31 +0700 Subject: [PATCH] Do not output HTML on empty descriptions --- Game.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Game.php b/Game.php index 8c56f97..b233b10 100644 --- a/Game.php +++ b/Game.php @@ -106,14 +106,17 @@ class Game { $output .= " by *".trim($this->author)."*"; } } - if (FORMAT === 'MARKDOWN') { - $output .= "\n\n > ".$converter->convert($this->getDescription(), 'html', 'markdown_github')."\n"; - } - if (FORMAT === 'HTML') { - $output .= "\n
".$this->getDescription()."
\n"; - } - if (FORMAT === 'MARKDOWN') { - $output .= "\n"; + $description = $this->getDescription(); + if ($description !== '') { + if (FORMAT === 'MARKDOWN') { + $output .= "\n\n > ".$converter->convert($this->getDescription(), 'html', 'markdown_github')."\n"; + } + if (FORMAT === 'HTML') { + $output .= "\n
".$this->getDescription()."
\n"; + } + if (FORMAT === 'MARKDOWN') { + $output .= "\n"; + } } if (FORMAT === 'HTML') { $output .= "\n";