Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Discovered at #3282233-17: Ability to configure additional languages (e.g. "bash" or "SQL") for CKEditor 5 CodeBlock plugin.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#8 | 3284254-8.patch | 3.4 KB | Wim Leers |
#8 | interdiff.txt | 884 bytes | Wim Leers |
#3 | 3284254-3.patch | 2.94 KB | Wim Leers |
#3 | interdiff.txt | 1.65 KB | Wim Leers |
#2 | 3284254-2.patch | 1.31 KB | Wim Leers |
Comments
Comment #2
Wim LeersComment #3
Wim LeersComment #5
nod_FilterHtml doesn't throw an error for that kind of configuration it silently ignores it: https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/modules/filt...
Not sure if it's relevant or not, but just pointing out it's a difference of handling between two similar things
Comment #6
Wim Leers@nod_ Yep, but that's because
FilterHtml
stores a setting that is essentially user input. Here, we want to be able to compare HTML restrictions. This gets in the way of that. It's up to the code generatingHTMLRestrictions
objects to only construct valid "HTML restrictions".That's why this patch only touches
HTMLRestrictions
, notFilterHTML
. So no existing code paths are affected 👍Comment #7
smustgrave CreditAttribution: smustgrave at Mobomo commentedWon't this change break sites that are using class="*". there's a number of filter tickets I believe open about that.
Comment #8
Wim Leers@smustgrave Fair point!
To prove that this does not cause a failure in those cases, here's an explicit test case proving that parsing from
filter_html
-like syntax still works as expected. This patch is only explicitly detecting an internal representation edge case that makes no sense.Comment #9
Wim LeersThe failure on
10.0.x
is an unrelated random failure:Comment #10
smustgrave CreditAttribution: smustgrave at Mobomo commentedTested on 10.1
<p class="*">
to Source Editing field<p class>
Because I saw this in ckeditor4 where the style would override a wildcard charcter
<p class="*">
to Source Editing field<p class>
Everything seemed to work for me.
Comment #11
Wim LeersThanks, much appreciated @smustgrave! 😊
Comment #12
alexpottBackporting to 9.4.x because ckeditor is experimental there and this is a low-rick bug fix.
Committed and pushed 846cce70f4 to 10.1.x and 2bdd1d4a88 to 10.0.x and 1a518cdeb5 to 9.5.x and 46aadfc71a to 9.4.x. Thanks!