]> _ Git - pmi.git/commitdiff
Convert textarea to markdown | wip #2742 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 17 Jul 2019 10:07:15 +0000 (12:07 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 17 Jul 2019 10:07:15 +0000 (12:07 +0200)
app/SubForms/Intro.php
resources/views/partials/intro.blade.php

index 11d0f7b0626a3911925f03819c2f77fedf55be75..002f120289a1a19f9956ee9574822bb6ebe34db1 100644 (file)
@@ -13,7 +13,7 @@ class Intro extends SubForm
         parent::init();
         $this->addField(['name' => 'title',
             'label' => 'Titre',
-            'type' => 'Textarea',
+            'type' => 'Markdown',
             'attributes' => [
                 'rows' => '2', // Sometimes we need to put line breaks in titles, hence the textarea
             ]]);
index 36752353b5a6a640740bfcbb405753834f6099c2..ce3832501ba011e35f4e2628ea54eb1bd938c270 100644 (file)
@@ -22,8 +22,7 @@
 
             <column>
                 <text-block class="pt-2v" title-class="h1 overlap-left" :title="$title">
-                    {{-- Todo: make a better function for converting plain text into paragraphs and breaks --}}
-                    <p>{!! nl2br($page->get("$name.text")) !!}</p>
+                    @markdown($page->get("$name.text"))
 
                     {{-- Todo: handle button here... $page->get("$name.button") --}}
                 </text-block>