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 the recipe.yml file in it has

name: 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 successfully

But 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 the recipe.yml file in it has

name: 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 successfully                                                                  
                                                                                                                        

But 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

Command icon 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

Rajab Natshah created an issue. See original summary.

rajab natshah’s picture

Issue summary: View changes

Rajab Natshah changed the visibility of the branch 3465033-fix-not-saving to hidden.

rajab natshah’s picture

Issue summary: View changes

rajab natshah’s picture

Assigned: rajab natshah » Unassigned
Status: Active » Needs review
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
smustgrave’s picture

Version: 10.3.x-dev » 11.x-dev
Status: Needs review » Needs work

Instead of 2 if statements can't they just be combined if it equals '-' or '|'

Also kinda feels like something that may need test coverage.

rajab natshah’s picture

Thanks, Stephen, for the quick review.
Your logic make since.

rajab natshah’s picture

Issue summary: View changes
thejimbirch’s picture

Issue tags: +Recipes initiative
rajab natshah’s picture

Version: 11.x-dev » main