I have a similar issue - I have a textarea that gets saved to the db. When I display it, I lose the line breaks. if I wrap with nl2br the break tag is displayed as text rather than rendered as a line break so my output looks like this:
this is some text<br />this is the next line
checking the source and the break tag is served as:
@lt;br />
in my blade file I tried the following:
{{ $words }} //No line breaks displayed
{{ nl2br($words )) }} // result as described above
{{ nl2br(e($words)) }} // result as described above
Any clues as to why this may be happenning?
@hairmenu with e() that should be fixed info: https://stackoverflow.com/questions/33075158/what-is-the-e-method-in-laravel-views-for
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community