Problem/Motivation

After following the steps from the CKEditor5 update path test page I noticed that on existing content, the <h1> element got stripped. Problem is the <h1> config to make the HTML tag allowed, get's lost.

Steps to reproduce

Have a full html text format with h1-h6 enabled on CKEditor.
Update to CKEditor5.
View the node with the <h1> and the <h1> get's stripped, instead of being rendered.

Issue fork drupal-3273527

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joevagyok created an issue. See original summary.

joevagyok’s picture

Issue summary: View changes
Wim Leers’s picture

Issue tags: +drupaldevdays, +Needs tests
Wim Leers’s picture

Title: h1 becomes not allowed after moving to ckeditor5 » Upgrade path never configures the ckeditor5_heading plugin to allow <h1>

We've identified the root cause of the bug:

foreach (range(2, 6) as $index) {

in \Drupal\ckeditor5\Plugin\CKEditor4To5Upgrade\Core::computeCKEditor5PluginSubsetConfiguration() should be

foreach (range(1, 6) as $index) {

🤣

Simple fix. 👍

But first we need a failing test 🤓 I asked @joevagyok to add a new test case to \Drupal\Tests\ckeditor5\Kernel\SmartDefaultSettingsTest::provider() — that should fail. And then applying the fix should result in tests passing :)

Wim Leers’s picture

Issue tags: -drupaldevdays +ddd2022

joevagyok’s picture

Issue summary: View changes
Wim Leers’s picture

Assigned: Unassigned » Wim Leers
Status: Active » Needs work
Issue tags: -Needs tests

That looks great! 🤩

As soon as tests come back red and green, I'll RTBC! 🤓

Wim Leers’s picture

Status: Needs work » Reviewed & tested by the community

It seems @joevagyok confused either GitLab or DrupalCI by using git push --force 😬 Hence those 4 trivial commits by me to prove that this MR is indeed failing when expected and fixing the bug!

alexpott’s picture

Version: 9.4.x-dev » 9.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed a1244cefd5 to 10.0.x and 307e3b7a4e to 9.4.x and 03a0f1f2a3 to 9.3.x. Thanks!

  • alexpott committed a1244ce on 10.0.x
    Issue #3273527 by joevagyok, Wim Leers: Upgrade path never configures...

  • alexpott committed 307e3b7 on 9.4.x
    Issue #3273527 by joevagyok, Wim Leers: Upgrade path never configures...

  • alexpott committed 03a0f1f on 9.3.x
    Issue #3273527 by joevagyok, Wim Leers: Upgrade path never configures...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.