NOW MANAGED ON CODEBERG
ExportFormatter: Add book description and check for empty book and chapter descriptions in markdown export
czemuf12946d581fe
diff --git a/app/Entities/Tools/ExportFormatter.php b/app/Entities/Tools/ExportFormatter.phpindex beddfe8e6..e85992a9d 100644--- a/app/Entities/Tools/ExportFormatter.php+++ b/app/Entities/Tools/ExportFormatter.php@@ -315,7 +315,11 @@ class ExportFormatterpublic function chapterToMarkdown(Chapter $chapter): string{$text = '# ' . $chapter->name . "\n\n";- $text .= $chapter->description . "\n\n";++ if (!empty($chapter->description)) {+ $text .= $chapter->description . "\n\n";+ }+foreach ($chapter->pages as $page) {$text .= $this->pageToMarkdown($page) . "\n\n";}@@ -330,6 +334,11 @@ class ExportFormatter{$bookTree = (new BookContents($book))->getTree(false, true);$text = '# ' . $book->name . "\n\n";++ if (!empty($book->description)) {+ $text .= $book->description . "\n\n";+ }+foreach ($bookTree as $bookChild) {if ($bookChild instanceof Chapter) {$text .= $this->chapterToMarkdown($bookChild) . "\n\n";