]> BookStack Code Mirror - bookstack/commitdiff
Fixed chapter description not showing in book exports
authorDan Brown <redacted>
Sat, 25 May 2019 14:21:02 +0000 (15:21 +0100)
committerDan Brown <redacted>
Sat, 25 May 2019 14:21:02 +0000 (15:21 +0100)
Closes #1465

resources/views/books/export.blade.php
tests/Entity/ExportTest.php

index e1fabd800bd1c42c6cd42257bb6e81e2a28fc23c..61c16c72dc586282f298cb0c2f98421dd0c3f688 100644 (file)
@@ -58,7 +58,7 @@
         <h1 id="{{$bookChild->getType()}}-{{$bookChild->id}}">{{ $bookChild->name }}</h1>
 
         @if($bookChild->isA('chapter'))
-            <p>{{ $bookChild->description }}</p>
+            <p>{{ $bookChild->text }}</p>
 
             @if(count($bookChild->pages) > 0)
                 @foreach($bookChild->pages as $page)
index fdcd833665d267f380631110fc2fc51a7a6b6f27..683f23674d66ed6997c947c2d2fe409b67994f86 100644 (file)
@@ -76,6 +76,20 @@ class ExportTest extends TestCase
         $resp->assertHeader('Content-Disposition', 'attachment; filename="' . $book->slug . '.html"');
     }
 
+    public function test_book_html_export_shows_chapter_descriptions()
+    {
+        $chapterDesc = 'My custom test chapter description ' . str_random(12);
+        $chapter = Chapter::query()->first();
+        $chapter->description = $chapterDesc;
+        $chapter->save();
+
+        $book = $chapter->book;
+        $this->asEditor();
+
+        $resp = $this->get($book->getUrl('/export/html'));
+        $resp->assertSee($chapterDesc);
+    }
+
     public function test_chapter_text_export()
     {
         $chapter = Chapter::first();
Morty Proxy This is a proxified and sanitized view of the page, visit original site.