How to disallow caption and align options for embeds

Created on 6 September 2024, 7 months ago

Problem/Motivation

I am using CKEditor 5 with media library and entity embed. I would like my media items to be alignable and captionable, but I would like my entity embed items to have neither option.

I believe that in earlier versions, I could manually alter the "allowed HTML" to remove data-caption and data-align options from the <drupal-entity> item to make this work.

I also noticed that the Embed Media filters says:

If used in conjunction with the 'Align/Caption' filters, make sure this filter is configured to run after them.

so I thought that I might be able to move the "Display Embedded Entities" filter above the align and caption filter to disallow those abilities on embedded entities, but I am actually not even allowed to save the Text Editor configuration form with this configuration: I receive an error that "Display Embedded Entities" must be run after the caption and align filters.

I did notice that I can actually workaround this issue if I alter the Drupal\entity_embed\Plugin\CKEditor5Plugin\DrupalEntity plugin's annotation (the elements section) to remove the data-caption and data-align attributes. This does not really seem like a viable approach. I feel like I am missing something and I'm hoping someone can clarify.

I see there is a related issue: #3443587 β†’

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Active

Version

1.6

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States sonfd Portland, ME

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024