Problem/Motivation
Not able to add a divider or a wrapping in CKEditor 5
Using recipes
Steps to reproduce
Scenario: Add a divider to the Rich Editor with CKEditor 5
Given having a recipe named
"add-divider-to-rich-editor"
And therecipe.ymlfile in it hasname: Add Divider to Rich Editor description: 'A recipe to add a divider as (vertical separator) to the Rich Editor with CKEditor 5' type: optional config: actions: editor.editor.full_html: addItemToToolbar: item_name: '|'When I run
php core/scripts/drupal recipe /recipes/add-divider-to-rich-editor
Then I get the following out put[notice] A backup checkpoint was not created because nothing has changed since the "Backup before the 'Add Divider to Rich Editor' recipe." checkpoint was created. 2/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] Applied Add Divider to Rich Editor recipe. [OK] Add Divider to Rich Editor applied successfullyBut the divider was not added to the full_html text format
Scenario: Add a Wrapping to the Rich Editor with CKEditor 5
Given having a recipe named
"add-wrapping-to-rich-editor"
And therecipe.ymlfile in it hasname: Add Wrapping to Rich Editor description: 'A recipe to add wrapping to the Rich Editor with CKEditor 5' type: optional config: actions: editor.editor.full_html: addItemToToolbar: item_name: '-'When I run
php core/scripts/drupal recipe /recipes/add-wrapping-to-rich-editor
Then I get the following out put[notice] A backup checkpoint was not created because nothing has changed since the "Backup before the 'Add Divider to Rich Editor' recipe." checkpoint was created. 2/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] Applied Add Wrapping to Rich Editor recipe. [OK] Add Wrapping to Rich Editor applied successfullyBut the wrapping was not added to the full_html text format
Proposed resolution
- Add save before return in the divider
"|" - Add support for the wrapper
"-"with save before the return
Remaining tasks
- File an issue
- MR(s) on each active branch
- Test
- Review
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3465033
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 #2
rajab natshahComment #5
rajab natshahComment #8
rajab natshahComment #9
rajab natshahComment #10
rajab natshahComment #11
smustgrave commentedInstead of 2 if statements can't they just be combined if it equals '-' or '|'
Also kinda feels like something that may need test coverage.
Comment #12
rajab natshahThanks, Stephen, for the quick review.
Your logic make since.
Comment #13
rajab natshahComment #14
thejimbirch commentedComment #15
rajab natshah