generated from filamentphp/plugin-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
Issue
The TextEntry component used to display email TEXT content does not properly render line breaks in the content.
Current behavior
Line breaks in the email TEXT content are not displayed in the UI, causing all text to appear in a single line.
Expected behavior
Line breaks should be preserved and displayed correctly in the UI.
How to reproduce the bug
- Create an email with multiple lines of text in the TEXT part (not HTML)
Hello, This is a test email. Best regards, John - Send this email to a mailbox monitored by filament-mails
- View the email in the filament-mails interface
- Observe that all text appears in a single line
Package Version
2.0.0
PHP Version
8.2
Laravel Version
11.x
Which operating systems does with happen with?
macOS
Notes
Solution
Modifying the TextEntry component to use HtmlString resolves the issue:
// Before (current implementation)
TextEntry::make('text')
->hiddenLabel()
->copyable()
->copyMessage('Copied!')
->copyMessageDuration(1500)
->label(__('Text Content'))
->columnSpanFull(),
// After (proposed fix)
TextEntry::make('text')
->hiddenLabel()
->copyable()
->copyMessage('Copied!')
->copyMessageDuration(1500)
->label(__('Text Content'))
->formatStateUsing(fn (string $state): HtmlString => new HtmlString(nl2br(e($state))))
->columnSpanFull(),Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working