Subject: [PATCH] test --- Index: core/modules/ckeditor5/js/ckeditor5.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/core/modules/ckeditor5/js/ckeditor5.js b/core/modules/ckeditor5/js/ckeditor5.js --- a/core/modules/ckeditor5/js/ckeditor5.js (revision e08a3d908ec894b1285dd7fe0fb29ca9c9e53d57) +++ b/core/modules/ckeditor5/js/ckeditor5.js (date 1753765037429) @@ -324,7 +324,6 @@ const addedCss = [ `${prefix} .ck.ck-content * {display:revert;background:revert;color:initial;padding:revert;}`, `${prefix} .ck.ck-content li {display:list-item}`, - `${prefix} .ck.ck-content ol li {list-style-type: decimal}`, ]; const prefixedCss = [...addedCss].join('\n'); @@ -625,6 +624,30 @@ }, }; + Drupal.behaviors.editorStyleFix = { + attach(context) { + // CKEditor's DLL injects a style tag that overrides native list + // type styling. The following find the style(s) causing the problem + // and removes them. + // @todo remove this entire behavior when this issue is fixed + // https://github.com/ckeditor/ckeditor5/issues/14613 + [...document.styleSheets] + .filter((sheet) => sheet.ownerNode.hasAttribute('data-cke')) + .forEach((sheet) => { + [...sheet.cssRules].forEach((rule, ruleIndex) => { + if ( + rule?.selectorText && + (rule.selectorText.includes(' ol') || + rule.selectorText.includes(' ul')) && + !rule.selectorText.includes('type') + ) { + sheet.cssRules[ruleIndex].style['list-style-type'] = null; + } + }); + }); + }, + }; + // Redirect on hash change when the original hash has an associated CKEditor 5. function redirectTextareaFragmentToCKEditor5Instance() { const hash = window.location.hash.substring(1); Index: core/modules/ckeditor5/ckeditor5.module IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/core/modules/ckeditor5/ckeditor5.module b/core/modules/ckeditor5/ckeditor5.module --- a/core/modules/ckeditor5/ckeditor5.module (revision e08a3d908ec894b1285dd7fe0fb29ca9c9e53d57) +++ b/core/modules/ckeditor5/ckeditor5.module (date 1753765497935) @@ -698,5 +698,36 @@ } $editor->setSettings($settings); + + if ($editor->getEditor() === 'ckeditor5') { + $settings = $editor->getSettings(); + // @see ckeditor5_post_update_list_type() + if (array_key_exists('ckeditor5_list', $settings['plugins']) && array_key_exists('ckeditor5_sourceEditing', $settings['plugins'])) { + $source_edited = HTMLRestrictions::fromString(implode(' ', $settings['plugins']['ckeditor5_sourceEditing']['allowed_tags'])); + $format_restrictions = HTMLRestrictions::fromTextFormat($editor->getFilterFormat()); + + // If neither
    or