Change record status: 
Project: 
Introduced in branch: 
9.3.x
Introduced in version: 
9.3.0-beta1
Description: 

CKEditor 4 was added to Drupal core in 8.x. It is a stable project but it will stop being supported sometime in 2023, around the same time as Drupal 9's EOL.

Replacing CKEditor 4 with the new and very much improved CKEditor 5 was identified as a Drupal 10 initiative.

This new experimental module provides integration for CKEditor 5 in Drupal and provide a way for other contrib projects to add their own CKEditor 5 plugins and configuration.

Screenshot of CKEditor 5 built-in dialog replacement

Want to give it a try?

  1. Install CKEditor 5 module.
  2. For every text format you want to try CKEditor 5 on: export its "Text Editor" configuration at /admin/config/development/configuration/single/export so you can re-import it after you're done with testing
  3. Update your existing text format to use CKEditor 5 in the admin UI.
  4. You should see something like Screenshot of the automatically generated CKEditor 5 toolbar configuration from the previous screenshot. Messages are present explaining what happened.
  5. Read the messages (if you want details), or just look at the resulting CKEditor 5 configuration.
  6. Save and use it 🥳
  7. Give feedback! 🙏
  8. Revert back to your CKEditor 4 configuration by using the exported configuration. Using experimental modules in production isn't recommended.
  9. Uninstall the module.
Impacts: 
Site builders, administrators, editors
Module developers
Themers
Distribution developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done

Comments

redseujac’s picture

I wanted to test the core experimental CKEditor 5 in my Drupal 9.4.1. It did not work and leads to "The website encountered an unexpected error. Please try again later." Notice I use core’s “Seven” theme as an administration theme, and I checked the box to use the administration theme for my node forms.

I installed and enabled core experimental CKEditor 5 and selected it as full html editor. As expected text format reported that I had themes (Classy and Seven) using the ckeditor_stylesheets setting without an equivalent ckeditor5-stylesheets setting.

So I went to core/themes/classy and edited the Classy.info.yml. After the key ckeditor_stylesheets and its content, I added ckeditor5-stylesheets: false. I did the same for the theme Seven.

I cleared all caches. Nothing to do. It didn't work and when I wanted to edit a node or create a new one, I got "The website encountered an unexpected error".

I found the culprit. It was due to the modules "Insert" and "Colorbox Insert". I uninstalled those modules and it's working now even without setting ckeditor5-stylesheets: false.

Conclusion: ckeditor 5 is not compatible with the modules Insert and Colorbox insert.

I assume the actual Drupal Core experimental CKEditor 5 is the "Classic Editor". What about the font plugin and the font color and font background color plugins. With the actual CKEditor 5 I cannot choose a font family nor a font size and I cannot color text nor background. These should always be part of the deafult CKEditor 5 in Drupal 9 and higher.

Wim Leers’s picture

See https://www.drupal.org/docs/core-modules-and-themes/core-modules/ckedito...

The conclusion Conclusion: ckeditor 5 is not compatible with the modules Insert and Colorbox insert. is wrong — contrib modules need to be updated! And in this case, it's just a plain bug: that module would have crashed with every other text editor plugin! Installed it, found the root cause, posted a fix: #3314445: insert_editor_js_settings_alter() assumes CKEditor 4 is enabled, crashes otherwise. For CKEditor 5 compatibility, I created #3314446: CKEditor 5 compatibility.

What about the font plugin and the font color and font background color plugins.

See #3239667: Drupal 10 & CKEditor 5 readiness 😊

These should always be part of the deafult CKEditor 5 in Drupal 9 and higher.

They never will be. It may be an individual site's decision to allow choosing fonts, font colors, background colors and so on. But Drupal core's stance is that this is not recommended, because it can easily result in inconsistent styling.

redseujac’s picture

If the font plugin and font color and font background color plugins will never be part of CKEditor 5 in Drupal 9 and higher, then at least it should be possible to use those plugins from other modules. Can you imagine websites with only black text? the user-friendliness of CKEditor 4 allowing to use those plugins is now greater than CKEditor 5 if you understand what I mean.

redseujac’s picture

The newest CKEditor 5 in Drupal 9.4.8 does not work. After changing CKEditor to CKEditor 5 in my existing text formats (e.g. Full html) and trying to save I get "The website encountered an unexpected error".

In Recent Log Messages I read:
Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: The "ckeditor5_imageUpload" CKEditor 5 plugin definition has a "drupal.admin_library" key whose asset library "ckeditor5/admin.imageupload" does not exist. in Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition->validateDrupalAspects() (regel 235 van /var/www/vhosts/daproverb.be/httpdocs/core/modules/ckeditor5/src/Plugin/CKEditor5PluginDefinition.php).