Missing filter condition in linkit.ckeditor5.yml

Created on 9 June 2025, 4 days ago

Problem/motivation

The linkit.ckeditor5.yml doesn't have a filter condition. Because of this, the JS code for CKEditor5 plugin is always loaded, regardless of whether the Linkit URL converter filter is enabled in the text format settings.

This leads to unnecessary JS payload, which may cause conflicts with other editor plugins.

Steps to reproduce

  1. Go to the text format settings.
  2. Disable the Linkit URL converter filter.
  3. Open any page with a text editor using this text format (e.g. node edit).
  4. Open the browser JS console, inspect the CKEditor5.linkit expression.
  5. Observe the plugin being loaded while it shouldn't be.

Proposed resolution

Add the filter: linkit condition to conditions in the linkit.ckeditor5.yml file.

This module uses Gitlab CI for automated testing of proposed code changes. To contribute code changes, create a merge request. Patch files will not trigger automated testing and are not sufficient for review.
πŸ› Bug report
Status

Active

Version

7.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

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

Merge Requests

Comments & Activities

  • Issue created by @abramm
  • πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

    Submitted the MR, attaching a patch for composer.

  • Pipeline finished with Failed
    4 days ago
    Total: 467s
    #517546
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    Awesome. This makes a lot of sense. I was unaware of the `filter` attribute for CKEditor configuration.

    However, this change appears to cause tests to fail, where they are not on 7.x (see https://git.drupalcode.org/project/linkit/-/pipelines/517840). Therefore, I'm setting this to "Needs work" to identify whether this filter is in fact interfering with the necessary elements that are allowed on the CKEditor-enabled text format, as indicated by the test output:

    The current CKEditor 5 build requires the following elements and attributes: <br><code>&lt;br&gt; &lt;p&gt; &lt;* dir=&quot;ltr rtl&quot; lang&gt; &lt;a href&gt;The following elements are not supported: &lt;a data-entity-type data-entity-uuid data-entity-substitution&gt;',
    
Production build 0.71.5 2024