Laravel没有渲染HTML

I tried rendering html markup with content that I have from the database. It's a bunch of text with a simple <a> tag.

this is how it's set in the database field. The database fieldtype is varchar(200)

and the collation is utf8_unicode_ci

This is the value of the field:

blablabla &lt;a href=&quot;mailto:info@atmox.nl&quot;&gt;info@atmox.nl&lt;/a&gt; blablabla

I tried using only the {!! !!} blade syntax, but it would just render the markup as plain text. eventually I tried the html_entity_decode and htmlspecialchars_decode functions, but it's results are the same. plain text.

this is the html part

<p>{!! $baan->descriptiond !!}</p>

Try to render using htmlentities($baan->descriptiond), html_entity_decode($string) on your data and then use {{ $baan->descriptiond }} to render html.

OR

just use a plain laravel blade:

{{$baan->descriptiond}}

You really should be able to do this:

<p>{!! html_entity_decode($baan->descriptiond) !!}</p>

That is assuming $baan->descriptiond is something like:

&lt;a href=&quot;mailto:info@atmox.nl&quot;&gt;info@atmox.nl&lt;/a&gt;

you need to do this way

{!! $text !!}

string will auto escape when you perform {{ }}

For laravel 5

{!!html_entity_decode($text)!!}