From 6c110c77ad4f63e84d7083a22650633d0369bd02 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 17 Jul 2019 12:07:15 +0200 Subject: [PATCH] Convert textarea to markdown | wip #2742 @0.5 --- app/SubForms/Intro.php | 2 +- resources/views/partials/intro.blade.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/SubForms/Intro.php b/app/SubForms/Intro.php index 11d0f7b..002f120 100644 --- a/app/SubForms/Intro.php +++ b/app/SubForms/Intro.php @@ -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 ]]); diff --git a/resources/views/partials/intro.blade.php b/resources/views/partials/intro.blade.php index 3675235..ce38325 100644 --- a/resources/views/partials/intro.blade.php +++ b/resources/views/partials/intro.blade.php @@ -22,8 +22,7 @@ - {{-- Todo: make a better function for converting plain text into paragraphs and breaks --}} -

{!! nl2br($page->get("$name.text")) !!}

+ @markdown($page->get("$name.text")) {{-- Todo: handle button here... $page->get("$name.button") --}}
-- 2.39.5