Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

HTML getting escaped

I’m using the BeautyMail package to send email via Laravel 8.83. I’m using:

@if ($pasted_content)
   {!! $pasted_content !!}
 @else
   <a href="{{ $temporary_url }}">{{ $temporary_url }}</a> (This link is valid for 7 days)
 @endif

in my blade.php, however the $pasted_content is being converted to the corresponding HTML entities. Is there a way that I can force it to keep the HTML tags?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Blade’s {{/}} escape the value and it is expected behavior. To output contents raw, you need to use {!!/!!} respectively.

See official docs chapter "Displaying Unescaped Data".

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading