Infolist data from Form textarea

Hey all I have some data saved using a Textarea with mulitple lines. Is there a standard practice way to get the line breaks to show when using TextEntry on an infolist? thank you
4 Replies
Sydd
Sydd3w ago
TextEntry::make('description') ->html()
David | Fortune Validator
I did try that but it didn’t give me the line breaks
dissto
dissto3w ago
Perhaps you could something like this:
->formatStateUsing(fn (string $state): HtmlString => new HtmlString(nl2br($state)))
->formatStateUsing(fn (string $state): HtmlString => new HtmlString(nl2br($state)))
🤔 https://www.php.net/manual/en/function.nl2br.php
David | Fortune Validator
I’ll give this a whirl, thank you
Want results from more Discord servers?
Add your server