Problem/Motivation
When using CKEditor5 in Drupal 10.1 with a CSP that does not have 'unsafe-inline' in the style-src directive, CKEditor fails to load properly. (See attached screenshot).
As documented by CKEditor5, style-src requires unsafe-inline: https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/csp.html
Steps to reproduce
Proposed resolution
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | csp-ckeditor5_unsafe_inline-3386187-6.patch | 1.66 KB | chrissnyder |
| CKEditor5_without_unsafe-inline_style-src.png | 324.22 KB | chrissnyder |
Issue fork csp-3386187
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:
Comments
Comment #3
chrissnyderComment #4
chrissnyderComment #5
chrissnyderComment #6
chrissnyderRelated patch file.
Comment #8
gappleMade some changes to make handling libraries that load editors via ajax a little more generic. Quickedit will be getting removed soon as part of dropping D9 support, but I think it still makes the pattern a little clearer for other modules that may need to do the same thing.
Comment #10
gapple