Problem/Motivation
Steps to reproduce
- Drupal 10, default theme
- Install/enable module, add to CKEditor
- Create some content, add Bootstrap grid to the body of content, add some text, save
- Go to content page as editor or as ANON user (browsers used: Chrome, Safari, FireFox)
Content is displayed in an editable div (see video of the issue).
The issue is div has attribute contenteditable="true"
see reference: Mozilla docs - contenteditable
see screenshot:
Proposed resolution
Remove any CKEditor-related classes and attributes before rendering content
This issue is very significant for D10/CKEditor 5.
Maybe implement Bootstrap Grid like this https://www.drupal.org/project/ckeditor_accordion?
Comment | File | Size | Author |
---|---|---|---|
EditableDiv-SourceCode.png | 264.01 KB | jannakha | |
EditableDiv.gif | 337.62 KB | jannakha |
Issue fork ckeditor_bs_grid-3364757
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
b_sharpe CreditAttribution: b_sharpe at ImageX commentedComment #4
jannakha CreditAttribution: jannakha as a volunteer and at Tomato Elephant Studio commentedmaybe a Filter is an answer? they are already used to clean up/fix up HTML in CK Editor.
Here's an example:
https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/modules/fil...
Comment #5
Thomas Kaisuka CreditAttribution: Thomas Kaisuka as a volunteer and at Century Marvel Digital Solutions commentedI just ran into this problem. It makes content rendering messy for anonymous users
Comment #7
b_sharpe CreditAttribution: b_sharpe at ImageX commentedMR should fix the issue. Unfortunately this does not fix already created grids unless you edit/save. As mentioned before you might be able to use a filter to do fix existing content.
Comment #8
jannakha CreditAttribution: jannakha as a volunteer and at Tomato Elephant Studio commentedtested on D10 - works!
thanks for the patch!
Comment #9
ivnish CreditAttribution: ivnish commentedMR works, but I need to recreate my grid.
Please commit and create new release soon
Comment #11
b_sharpe CreditAttribution: b_sharpe at ImageX commentedCommitted, thanks