[GHS] <i class="anything"> in Full HTML

Created on 14 October 2023, over 1 year ago
Updated 3 November 2023, about 1 year ago

Problem/Motivation

Identify the correct version of Drupal core modules
There is a bug in CKEditor 5 v38 and below that strips < i class>
But does Drupal 10.1.5 have CKEditor 5 v39?
I'm still getting the bug that I read was fixed in CKEditor 5 v39 so I wonder if Drupal actually has the bug fixed version of CKEditor 5

Steps to reproduce

Install Drupal 10.1.5
Click on extend
Expand information about CKEditor 5
Version is reported as 10.1.5 -> this is not correct it is 38.xx or 39.xx

Proposed resolution

Report the correct version of core modules

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

10.1

Component
CKEditor 5 

Last updated about 22 hours ago

Created by

🇦🇺Australia markagregory

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

Comments & Activities

  • Issue created by @markagregory
  • Come now, this version report isn't a bug in Drupal. 10.1.5 is the version of the ckeditor5 module. Drupal 10.1.5 shipped with CKEditor version 39.0.1. That is seen in core/core.libraries.yml.

  • Status changed to Fixed over 1 year ago
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
  • 🇦🇺Australia markagregory

    Please carefully read what I've written. It states that the problem is still in drupal 10.1.5
    Yes, I read that it is meant to be fixed in 10.1.3 but the problem did not appear to be fixed.
    I can duplicate this issue, so what is the problem with ckeditor 5 still there?
    And drupal does not tell the user what version of ckeditor 5 is being used.

  • @markagregory It is fixed but

  • Status changed to Postponed: needs info over 1 year ago
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    @markagregory: There is explicit test coverage for this at \Drupal\Tests\ckeditor5\FunctionalJavascript\SourceEditingEmptyElementTest::testEmptyInlineElement(), so please provide steps to reproduce 🙏

    I can duplicate this issue, so what is the problem with ckeditor 5 still there?

    Please open your browser's console and execute:

    CKEDITOR_VERSION
    

    What do you see?

    To @ReINFaTe's point in #7: can you please export your text format + text editor config entities and upload them here so we can reproduce?

    You do need to explicitly allow <i class> if you do not want it to be stripped, at least when using a text format that does not allow arbitrary HTML.

    (And @ReINFaTe is right that that would be worth adding to the change record! I'll wait for @markagregory to confirm that was it, and will then update the change record. Most people just use https://www.drupal.org/project/fontawesome , in which case 📌 CKEditor 5 compatibility Needs review would remove the need for that, but I understand some prefer to write this markup manually.)

  • @Wim Leers I've uploaded configs but, AFAIK it works the same way with any text format.
    With these configs added empty <i class="anything"></i> tags will be removed. Adding <i> for formats without "filter_html" or <i class> to "Manually editable HTML tags" will fix that and empty <i> tags can be added after that.
    \Drupal\Tests\ckeditor5\FunctionalJavascript\SourceEditingEmptyElementTest::testEmptyInlineElement() Works because it adds needed tags as editable.
    There is no "bug" only non-obvious behaviour from the user side. As the user, I'm not sure how I am supposed to know to add these to "Manually editable HTML tags" to allow them to be empty, especially when using full_html format which allows everything.
    As a developer, I was looking in the code to see that.
    \Drupal\ckeditor5\Plugin\CKEditor5Plugin\SourceEditing::getDynamicPluginConfig Most likely this code is responsible for that.

  • Status changed to Active about 1 year ago
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Thanks for providing the detailed bug report, now I can actually reproduce your use case 👍

    […] because it adds needed tags as editable. […] especially when using full_html format which allows everything.

    I agree that this should be considered a bug. Will investigate.

    P.S.: thanks for all the awesome contributions you've been posting lately! 🤩

Production build 0.71.5 2024