Make it compatible with CKEditor5

Created on 21 September 2022, about 2 years ago
Updated 28 April 2023, over 1 year ago

Problem/Motivation

CKEditor 5 (core module D9.3+) only works with filters, that declare they work with HTML formats. Therefore, the type of the filter needs to be changed to Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE

Steps to reproduce

Drupal 9.4
PHP: 8.1.7
Hashtags v8.x-10

Administration > Configuration > Content authoring > Text formats and editors

Text Editor: (select) CKEditor 5

Enabled filters: (select) Hashtags Filter

Error message
"CKEditor 5 only works with HTML-based text formats. The "Hashtags Filter" (filter_hashtags) filter implies this text format is not HTML anymore.".

Proposed resolution

Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE

Note: Hashtags appears to work fine with D9.4 when selecting Text Editor: None.

View
'Upgrade coordination for modules providing CKEditor 4 plugins'
by Wim Leers:
https://www.drupal.org/docs/core-modules-and-themes/core-modules/ckedito...

💬 Support request
Status

Active

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇷🇺Russia cuman

    It works:

    - *   type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE,
    + *   type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,

    in FilterHashtags.php

Production build 0.71.5 2024