EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

Unable to use custom block types in TextEditorField

Open jahudka opened this issue 2 years ago • 0 comments

Given the following field:

yield TextEditorField::new('content')
    ->setTrixEditorConfig([
        'blockAttributes' => [
            'default' => ['tagName' => 'p'],
            'heading1' => ['tagName' => 'h2'],
        ], 
    ]);

When editing an existing entity the configured block attributes aren't respected - all <p> and <h2> tags in the editor are converted to <div>.

This happens with EasyAdmin v4.3.4. Looks like the cause is the Trix editor itself (see here) - and from what I'm seeing I'd suggest the best possible fix for this issue would be to abandon Trix in favour of something sane and mature.

jahudka avatar Aug 19 '22 00:08 jahudka