Rich Editor escaping its own HTML

Hi all, I'm trying to add a Rich Editor to my form, but after saving the data in the database is escaped. It's already escaped when i dd() at EditRecord#148. Because of this the Rich Editor shows as attached after saving. Anybody else had this issue? If so, how can I fix this? Thanks in advance!
No description
Solution:
Never mind @Alnuaimi and others: I found a global Laravel middleware messing with the payload and escaping characters like this. I thought Filament had its own middlewares only, but apparently a base layer of middleware of Laravel is also applied. Thanks for your help....
Jump to solution
7 Replies
Alnuaimi
Alnuaimi4w ago
use RichEditor not markdown
Mike Peters
Mike PetersOP4w ago
hi, thanks for your reply, but this is the RichEditor:
RichEditor::make(...)
RichEditor::make(...)
Alnuaimi
Alnuaimi4w ago
can you tack screen for your code
Mike Peters
Mike PetersOP4w ago
RichEditor::make('name')
->label('Naam van campagne')
->helperText(fn (string $operation): ?string => 'create' === $operation
? 'Een beschrijvende naam zorgt dat deze makkelijk terug te vinden is.'
: null)
->required(),
RichEditor::make('name')
->label('Naam van campagne')
->helperText(fn (string $operation): ?string => 'create' === $operation
? 'Een beschrijvende naam zorgt dat deze makkelijk terug te vinden is.'
: null)
->required(),
On edit page I put in text, make it bold using toolbar buttons, but after save it's escaped like this: <p><strong>test</strong></p>
Solution
Mike Peters
Mike Peters4w ago
Never mind @Alnuaimi and others: I found a global Laravel middleware messing with the payload and escaping characters like this. I thought Filament had its own middlewares only, but apparently a base layer of middleware of Laravel is also applied. Thanks for your help.
Alnuaimi
Alnuaimi4w ago
no no you do not use Laravel middleware messing with the payload and escaping characters like this Filament RichEditor is working very good you can check filament V or Laravel ,or you can user RichEditorin another place or definite project for test
Mike Peters
Mike PetersOP4w ago
Yes thanks, totally agree. I have to add Filament to an existing project so the middleware is already there. Will remove it for Filament

Did you find this page helpful?