Problem/Motivation

I followed instructions here to upgrade my text format to CKE5.
I previously had a Styles CKE button allowing me to add h2, h3,... tags, BUT not h1. After I upgraded, my Styles button is replaced with a Headings button. That's OK but now I can add h1 tags, which should not happen.

Steps to reproduce

The config files I had are attached. Obviously there are other problems on upgrade path but this issue is only about Styles to Headings change (#3222797: Upgrade path from CKEditor 4's StylesCombo to CKEditor 5's Style).

Proposed resolution

Has the Headings button is configurable, the headings available should be limited to those which were already allowed.

Remaining tasks

Find what's wrong in the code of CKE5 upgrade path and fix it.

User interface changes

None, except a fix.

API changes

None.

Data model changes

None.

Release notes snippet

No need.

Comments

GaëlG created an issue. See original summary.

gaëlg’s picture

Version: 9.4.x-dev » 9.5.x-dev
longwave’s picture

  plugins:
    stylescombo:
      styles: "h1|Titre H1\nh2|Titre H2\nh3|Titre H3\nh4|Titre H4\nh5|Titre H5\np|Paragraphe"

Your stylescombo config allowed h1 before? So I think that after the upgrade, h1 is allowed because of this.

gaëlg’s picture

Priority: Normal » Minor

Ahh... Good catch! Actually h1 was in stylescombo editor config, but was not allowed in format config. So it was not an option in the UI.

I'm not sure the upgrade path should be smarter in such a case where the previous config was somewhat inconsistent... At least there's a message:

Updating to CKEditor 5 added support for some previously unsupported tags/attributes. Un plugin a introduit la prise en charge des éléments suivants : La balise <h1>; Cet attribut : class (pour <h1>, <h2>, <h3>, <h4>, <h5>, <h6>); Des détails supplémentaire sont disponibles dans votre journal.
    Consulter cette page de manuel pour plus de détails sur les problèmes de compatibilités des modules contribués.
wim leers’s picture

Status: Active » Closed (works as designed)

I'm not sure the upgrade path should be smarter in such a case where the previous config was somewhat inconsistent...

It has to be "smarter". In order for <h1> to be supported (i.e. the tag can be created), this is necessary.

CKEditor 5 would not allow the equivalent configuration: StylesCombo in CKE4 and Style in CKE5 are intended not to support additional tags, but to create a particular "style/variant" of a tag (i.e. <tag class="some-style">). If you tried to configure CKE5 in the equivalent way, you'd get a validation error.