]> BookStack Code Mirror - bookstack/commitdiff
Support new lines for book/chapter descriptions
authorClément Blanco <redacted>
Fri, 14 Jul 2017 15:05:46 +0000 (16:05 +0100)
committerClément Blanco <redacted>
Fri, 14 Jul 2017 15:05:46 +0000 (16:05 +0100)
Avoid ignoring new lines when renderring the book/chapter descriptions on their respective detailed views.

resources/views/books/show.blade.php
resources/views/chapters/show.blade.php

index ddbe7a0a4ab0488fbe819a9204ccd7824a4f1e84..d5832b7086f1cabc0328f75287788ab75e2181a4 100644 (file)
@@ -56,7 +56,7 @@
 
                 <h1>{{$book->name}}</h1>
                 <div class="book-content" v-if="!searching">
-                    <p class="text-muted" v-pre>{{$book->description}}</p>
+                    <p class="text-muted" v-pre>{!! nl2br($book->description) !!}</p>
 
                     <div class="page-list" v-pre>
                         <hr>
                         <button v-if="searching" v-cloak class="text-neg" v-on:click="clearSearch()" type="button"><i class="zmdi zmdi-close"></i></button>
                     </form>
                 </div>
-                
+
                 <div class="activity">
                     <h3>{{ trans('entities.recent_activity') }}</h3>
                     @include('partials/activity-list', ['activity' => Activity::entityActivity($book, 20, 0)])
         </div>
     </div>
 
-@stop
\ No newline at end of file
+@stop
index d4126cbccee764fb95fd0d27dcb84d93a2df79c0..9b549cfbdfb194f6a43da739017270c2a149aa86 100644 (file)
@@ -52,7 +52,7 @@
             <div class="col-md-7">
                 <h1>{{ $chapter->name }}</h1>
                 <div class="chapter-content" v-if="!searching">
-                    <p class="text-muted">{{ $chapter->description }}</p>
+                    <p class="text-muted">{!! nl2br($chapter->description) !!}</p>
 
                     @if(count($pages) > 0)
                         <div class="page-list">