Configuration overlaps between Styles and other CKE5 plugins

Created on 8 July 2022, almost 2 years ago
Updated 15 February 2023, over 1 year ago

Problem/Motivation

Follow-up of #3222797: Upgrade path from CKEditor 4's StylesCombo to CKEditor 5's Style → , to fix the edge case reported by @DanielVeza at #3222797-97: Upgrade path from CKEditor 4's StylesCombo to CKEditor 5's Style → .

When using the Styles and the sourceEditing plugins there can be situation with conflicting configuration.

The main idea with CKE5 config is to not have two plugins with overlaping supported elements.

Steps to reproduce

  1. Set up a CKE5 text format with a Styles config of
    span.test|Test
    
  2. and a sourceEditing config of
    <span class>
    
  3. An error message is shown:
    A style must only specify classes not supported by other plugins. The test classes on <span> are already supported by the enabled Source editing plugin.

Proposed resolution

Discuss what needs to happen in that situation.

  1. Do nothing, since the user is expected to use sourceEditing to alter the span classes, the styles plugin shouldn't be able to touch those.
  2. It can make sense to have the Styles plugin add classes to an element for less technical users, while still allowing the source editing plugin to allow all classes for more technical users. (Removing the validation constraints, it's working as expected in the UI). It can introduce a grey area where unexpected behaviors happens though.

    In that case the resulting Allowed HTML tags will be as followed

    <span class>
    

Remaining tasks

Agree on a solution

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

9.5

Component
CKEditor 5  →

Last updated about 2 hours ago

Created by

🇫🇷France nod_ Lille

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States jksloan2974

    I am running php 8.1.14 and Drupal 9.5.3. I am still unable to add a span with class in the styles plugin.

    Here is the error message after trying to add span.test_class|Test Class to the Styles configure textarea

    Error message
    The Style plugin needs another plugin to create , for it to be able to create the following attributes: . Enable a plugin that supports creating this tag. If none exists, you can configure the Source Editing plugin to support it.

  • 🇺🇸United States bnjmnm Ann Arbor, MI

    @jksloan2974 I recommend bringing up your concern in #38 in Drupal Slack or opening a new issue describing the steps to reproduce. Issues are rarely re-activated, and in those rare instances it's within a few days of it being completed. Since it's been 5 months, this will not re-open to address your concerns, but if it were a new issue (or question in Slack), it can get some attention.

Production build 0.69.0 2024