Problem/Motivation
CKEditor 5 is in Drupal 10 core and making it's way in to Drupal 9 core via #3238333: Roadmap to CKEditor 5 stable in Drupal 9. This module needs to be updated to support CKEditor 5 without the CodeMirror addon as there are no plans to update it for CKEditor 5 (Compatibility with CKEditor 5.x?).
Proposed resolution
Develop a CKEditor 5 plugin directly in to the module that adds CodeMirror support to the CKEditor 5 SourceEditing plugin.
This work is underway in the 3.0.x branch.
Remaining tasks
Fix any issues with styles (borders missing in source edit mode)Wire up configuration options4-to-5 configuration migration handlingUpdate testsDetermine if the CKEditor 5 plugin can/should be independent of the Drupal module
User interface changes
TBD
API changes
TBD
Data model changes
TBD
Comments
Comment #2
matt_paz commentedComment #3
matt_paz commentedComment #4
matt_paz commentedComment #5
matt_paz commentedComment #6
wellsThanks @matt_paz!
Per https://github.com/w8tcha/CKEditor-CodeMirror-Plugin/issues/176 it seems that the maintainer of the underlying plugin for CKEditor does not intend to port the CodeMirror plugin to CKE5 so we will need to create out own unless another option turns up somewhere.
Comment #7
matt_paz commentedYa, I'd totally forgotten that I'd already filed an issue on w8tcha/CKEditor-CodeMirror-Plugin back in July. Unfortunately, I haven't run across anything similar for either ACE or CodeMirror (relative to support for CKE5). I haven't looked deeply tho. But yes, this may prove a heavier lift than one might have otherwise anticipated. I fear CKE5 might represent some interesting challenges for this plugin, but time will tell.
Comment #8
wellsI'm fiddling in a 3.0.x with the prospect of implementing this more directly (i.e. without the generic CKEditor CodeMirror plugin). Not sure if it will really work out. It seems like it should be straightforward but I might be missing something.
Currently I've got it to a point where when CKE5 goes in to source edit mode this module's plugin uses a (global, from library) CodeMirror instance to replace the CKE5 source editing
textarea. In it's current state the positioning is messed up and changes don't get saved (need to wire up an event for that apparently) but code does get highlighted!I'm also looking at CodeMirror 6 but it removes the
fromTextAreamethod that enables this in its current state. Understandably so because the performance is probably terrible for large sources. However if the current approach I'm trying doesn't really work a more complex implementation (essentially replacing source editing?) may be necessary anyway.Comment #9
matt_paz commentedNot sure if the progress on this issue will help, but I thought I'd pass it along on the chance it might represent a part of the puzzle.
Automatically use CKE5's General HTML Support feature on text formats without any TYPE_HTML_RESTRICTOR filter + add `sourceEditing` button
https://www.drupal.org/project/ckeditor5/issues/3216021
Comment #11
wellsI've got this basically functional in the 3.0.x branch now.
Things still TODO:
Comment #14
wellsComment #16
wellsComment #18
wellsComment #19
wellsComment #21
wellsComment #23
wells