RichEditor put tags
I am using the richeditor component, it works fine, it saves the content in the database but it adds the content inside tags like these: <p> <p/>
whats happening?
17 Replies
same problem if you find solution. alert me
That’s how all rich editors work. Content has to be at least in a p tag to make it valid and accessible markup.
It' because rich text editor's content field uses html tags to show style document.
for example if you use bold font style for your name
it's content chages like<bold>yourname</bold>
but
tags
show on the table. Is there any way to show styles
instead of tags
to my knowledge Trix doesn't support inline styles
What tags are shown?
if i move https://filamentphp.com/docs/3.x/tables/columns/text#displaying-a-description it below, agian, shows tags
Try
->description(fn($record) => new HtmlString($record->field))
Can you share the actual code of your column?
Would make this easier.
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\ImageColumn::make('thumbnail')->size(80),
Tables\Columns\TextColumn::make('title')
->searchable(),
Tables\Columns\TextColumn::make('slug')
->toggleable(),
TextColumn::make('body')
->description(fn (Blog $blog): string => $blog->body, position: 'below')
->markdown()
->searchable(),
Tables\Columns\IconColumn::make('active')
->boolean(),
Tables\Columns\TextColumn::make('published_at')
->label('Availability')
->dateTime()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
ResultTry ->html() instead of ->markdown()
tried not working is there any thing else..!
for your code to work you need.
1) For a column
2) For a column description
sorry mate couldn't work
here a file if it matters....!