Problem/Motivation

CKEditor 5 readiness issue to tackle all the thing to make this module work with CK-editor 5.

Steps to reproduce

Enable CK-editor5 and select it as editor. Use this module in the same text text format & enable one of the filters.
It gives the status message:

CKEditor 5 only works with HTML-based text formats. The... ... filter implies this text format is not HTML anymore.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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

Martijn de Wit created an issue. See original summary.

martijn de wit’s picture

Seems this happens because of the type definition.

type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE

Changing this to

type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE

Could resolve the problem. Only I don't know what happens with existing content in text fields if we change this.

danthorne’s picture

martijn de wit’s picture

@danthorne thnx for the ping.

martijn de wit’s picture

watching the solutions of other modules they all use
FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE

Guess we should use that too.

---Source:
https://git.drupalcode.org/project/insert_view/-/commit/f22f505
https://git.drupalcode.org/project/autofloat/-/commit/90e2c0d
https://git.drupalcode.org/project/toc_filter/-/commit/96a3762

danthorne’s picture

Switching to FilterInterface::TYPE_TRANSFORM_REVERSIBLE gets rid of the below error when choosing text editor

CKEditor 5 only works with HTML-based text formats. The "Button link styles" (editor_button_link_filter) filter implies this text format is not HTML anymore.
coen van vliet’s picture

StatusFileSize
new764 bytes

Adding a patch with the suggested change.

martijn de wit’s picture

Think we also have to modify the way, the extra fields are going to display in the new CK5 link pop-up

chrissnyder’s picture

For CKEditor 5, the ckeditor_link_styles module provides similar functionality.

danthorne’s picture

Thanks @ChrisSnyder

Just had a play with your module but currently there's no way to choose only one style. Example there could be 2 button styles and the editor could tick both by mistake.

Also this module adds attributes in the editor like data-drupal-button-link="button" data-drupal-button-link-style="button--primary" instead of just adding the class, which avoids admin theme conflict. Example, the gin admin theme also has a class of button, which looks different to the button that will be rendered in the frontend.

bakulahluwalia’s picture

#7 patch works just fine. No issues in the existing buttons as well. Any plans to merge it to upcoming release?

carolea’s picture

Hi,
Any updates on this please?
We would need a fix as well.
We've applied the patch but I don't see the type and styles dropdowns anymore.
Thanks!

martijn de wit’s picture

Will check this in coming weeks.

ericdsd’s picture

Hi is there any progress on this, i'd be happy to help testing as a non dev.

martijn de wit’s picture

Version: 2.0.x-dev » 3.0.x-dev
Assigned: Unassigned » martijn de wit
martijn de wit’s picture

Seems we have to rewrite a part of the module and create an upgrade path.

going to use the fork for this.

martijn de wit’s picture

Status: Active » Needs work

Committed some code to start. Still needs some work.

martijn de wit’s picture

martijn de wit’s picture

Assigned: martijn de wit » Unassigned
ericdsd’s picture

Great to see this issue is moving, i'll be glad to help testing once needed.

  • Martijn de Wit committed c4d08d82 on 3.0.x
    Issue #3307959 - work in progress @todo write all javascript / ckeditor...
danthorne’s picture

CKEditor 4 is no longer supported as of today.

martijn de wit’s picture

We are developing the new version at the 3.x branch.
PHP part is roughly done. JS part has to be done.

dima.iluschenko’s picture

Hi @Martijn de Wit!
Do you know the approximate date when this will be ready?

ericdsd’s picture

StatusFileSize
new17.25 KB

Attaching patch version of MR2 (#23) as it's now required instead of #7 patch that's not compatible with core 10.3+ (prevents saving text format).

minoroffense made their first commit to this issue’s fork.