Reputation: 2166
I have done saved the contents inside the #descrition
below.
<div id="description" contenteditable="true"></div>
My problem is when I try to display it does not display like an html format, it displays same like the saved data with <h1></h1>
& <br>
. It displays plain text only.
<div id="description" contenteditable="true">{{ $description }}</div>
<h1>Descriptoin</h1> Doner, where I built and maintained banner adverts and microsites. <br> And...
Someone know how to display this properly?
In laravel - {!! $description !!}
In vue - <div v-html="description"> </div>
Upvotes: 0
Views: 817
Reputation: 2295
By default Laravel escape special characters to prevent XSS attack. Try using this format:
<div id="description" contenteditable="true">{!! $description !!}</div>
Upvotes: 1
Reputation: 2117
You have to do like this , because Blade {{ }} statements are automatically sent through PHP's htmlspecialchars function to prevent XSS attacks.If you do not want your data to be escaped, you may use the following syntax:
<div id="description" contenteditable="true">{!! $description !!}</div>
Upvotes: 1