vendredi 29 septembre 2017

Markdown Laravel printing html code

I have installed Laravel Markdown but still printing HTML code.

my model

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use GrahamCampbell\Markdown\Facades\Markdown;
use Illuminate\Support\HtmlString;


class Post extends Model
{

    public function getContentHtmlAttribute($value)
{

     return Markdown::convertToHtml(e($this->content));

}
}

my blade page

{!! $post->content_html !!}

printing

<h2 style="font-family: DauphinPlain; line-height: 24px; 
color: rgb(0, 0, 0); margin: 0px 0px 10px; font-size: 24px; 
padding: 0px;">What is Lorem Ipsum?

Thank you



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire