ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.63k stars 3.71k forks source link

Remove Format for block elements #13983

Open filipsobol opened 1 year ago

filipsobol commented 1 year ago

In the https://github.com/ckeditor/ckeditor5/issues/11580 issue, we added the Remove Format feature for inline styles.

We need to implement the same for block styles as well.

See the scope of the previous ticket and implementation PR for more information.


If you'd like to see this improvement implemented, add a 👍 reaction to this post.

wimleers commented 1 year ago

FYI: this is a hard blocker for some Drupal users: https://www.drupal.org/project/drupal/issues/3321254.

niegowski commented 1 year ago

To make it possible we need to augment the RemoveFormatCommand in 2 places:

Styles feature stores classes in GHS attributes so we can't use Schema attribute property to check it. Probably some extension point would be needed here:

https://github.com/ckeditor/ckeditor5/blob/67e060929bae2bacbc02bc8b82ceadaf1f96253f/packages/ckeditor5-remove-format/src/removeformatcommand.ts#L103-L111

While applying change it should be integrated with GHS to remove only classes registered in the Styles feature:

https://github.com/ckeditor/ckeditor5/blob/67e060929bae2bacbc02bc8b82ceadaf1f96253f/packages/ckeditor5-remove-format/src/removeformatcommand.ts#L54-L56

Witoso commented 3 months ago

When we look into this, following the discussion of https://github.com/ckeditor/ckeditor5/issues/11580#issuecomment-1495012553. 

The solution could be:

Potential problems:

prithvi2k2 commented 2 weeks ago

Strict format needs to be implemented ASAP