From 42a5ff97614cac7a7e2c955860cf451d9d3356d7 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Wed, 9 Sep 2015 13:41:33 +0100
Subject: [PATCH] Issue #2548723 by Wim Leers, cwells: Comment on or replace
 class name cleaning in CKEditorPlugin/Internal::getButtons()

---
 core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php
index 2e469daffeef..4959625a3683 100644
--- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php
+++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php
@@ -129,6 +129,9 @@ public function getButtons() {
     $button = function($name, $direction = 'ltr') {
       // In the markup below, we mostly use the name (which may include spaces),
       // but in one spot we use it as a CSS class, so strip spaces.
+      // Note: this uses str_replace() instead of Html::cleanCssIdentifier()
+      // because we must provide these class names exactly how CKEditor expects
+      // them in its library, which cleanCssIdentifier() does not do.
       $class_name = str_replace(' ', '', $name);
       return [
         '#type' => 'inline_template',
-- 
GitLab