Problem/Motivation
The module is not currently compatible with CKEditor 5.
Proposed resolution
Update: https://www.drupal.org/project/ckeditor5_paste_filter
After working on this more I decided to release the CKEditor 5 version as a separate module so that we don't have to maintain CKEditor 4 and CKEditor 5 code in the same codebase and to ease folks' upgrade paths.
Update to be CKEditor 5 compatible.
I would suggest that the CKEditor 5 version could be version 2.x.x of this module.
Remaining tasks
Create issue forkPost ported module as a merge request
User interface changes
n/a
API changes
n/a
Data model changes
n/a
Issue fork ckeditor_paste_filter-3341385
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:
- 3341385-create-ckeditor-5
compare
- 3341385-ckeditor5-port
changes, plain diff MR !2
Comments
Comment #3
star-szrI can see (at least) one or two more default rules we should add to get closer to parity with the CKEditor 4 version, so marking as needs work for that. But if anyone comes across this in the meantime feel free to test it and provide feedback.
The reasoning for more default rules is because CKEditor 5's paste from office plugin doesn't do as much cleanup as the CKEditor 4 version. See also #3254346: [upstream] CKEditor 5 PasteFromOffice plugin should not allow MS Office/Apple Pages/Google Docs-specific classes and styles even when HTML is unrestricted.
Comment #4
star-szrI did not try to port the code from https://git.drupalcode.org/project/ckeditor_paste_filter/-/blob/1.0.x/js... since it seems there is no equivalent in CKEditor 5.
https://github.com/ckeditor/ckeditor4/issues/4364
Comment #5
star-szrThis has gone through more testing and can be reviewed.
My next step will be to review #3304359: Make filter rules configurable. and see if I can incorporate that into the CKEditor 5 version. I think this functionality is more important since CKEditor 5 plugins are typically using webpack.
Comment #6
maxilein commentedThank you all.
Is this connected: https://www.drupal.org/project/ckeditor5_paste_filter or will it be version 2.0?
If so it says there on the module description:
may I suggest to add something like this from #3:
or even better list the rules implemented?
Comment #7
star-szrHi @maxilein thanks for taking a look, yes that is where the CKEditor 5 version will end up after thinking about it more, and I have emailed the maintainer of this CKEditor 4 module about it. I need a few days to get things ready on that other project and will update this issue once it's ready.
I have already added additional rules here which you can see in the merge request, the biggest feature I will be adding to the other project is to make the rules fully configurable (mentioned in #5 here), rather than providing only a hardcoded set of rules.
Comment #8
taote commentedHow can I download this version to test it?
Comment #9
star-szr@taote I am still working on the full project but you can download or clone a working version from https://git.drupalcode.org/issue/ckeditor_paste_filter-3341385/-/tree/33... to test the basic functionality.
Comment #10
jaydip makawana commentedThanks @cottser for the contribution. I will review and release this version once work done.
Comment #11
star-szr@JaydipJD thanks! I actually think the CK4 and CK5 versions should remain separate to ease the upgrade path and would rather close this issue without merging once I have a dev version up for the CK5 project. The config form for the CK5 version is taking a lot longer than expected but is “almost” ready now.
I could use some help maintaining https://www.drupal.org/project/ckeditor5_paste_filter if you are interested.
Comment #12
kepesv commentedhttps://git.drupalcode.org/issue/ckeditor_paste_filter-3341385/-/tree/33...
Tested and I can confirm that working properly! It could be the initial release as individual project.
Comment #13
star-szrHi @kepesv thank you for your interest and for testing it! The reason why I do not want to release that code as an initial or dev release is that I will immediately need to build an upgrade path to go from hardcoded to configurable filter rules. So I would rather the first public release (even dev release) already have the configurable rules part done.
The full version including configuration sync and configuration UI will be released on https://www.drupal.org/project/ckeditor5_paste_filter (I am aiming to have it up this week) and I will update this issue once that is done.
Comment #14
star-szrThe first alpha of https://www.drupal.org/project/ckeditor5_paste_filter has been released, testing and feedback would be very much appreciated so we can get it to a stable 1.0.0 release. Thanks to everyone who has tested and shown interest on this issue.
I am closing this issue and merge request because releasing the CKEditor 5 project completes what I started here. Thank you.