diff --git a/core/modules/ckeditor/ckeditor.admin.inc b/core/modules/ckeditor/ckeditor.admin.inc index 4ee12bb..21be21d 100644 --- a/core/modules/ckeditor/ckeditor.admin.inc +++ b/core/modules/ckeditor/ckeditor.admin.inc @@ -7,7 +7,6 @@ use Drupal\Component\Utility\Html; use Drupal\Core\Template\Attribute; -use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Language\LanguageInterface; /** @@ -66,10 +65,10 @@ function template_preprocess_ckeditor_settings_toolbar(&$variables) { $build_button_item = function($button, $rtl) { // Value of the button item. if (isset($button['image_alternative' . $rtl])) { - $value = SafeMarkup::set($button['image_alternative' . $rtl]); + $value = $button['image_alternative' . $rtl]; } elseif (isset($button['image_alternative'])) { - $value = SafeMarkup::set($button['image_alternative']); + $value = $button['image_alternative']; } elseif (isset($button['image'])) { $value = array( diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php index c405c7f..d4e4815 100644 --- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php @@ -9,6 +9,7 @@ use Drupal\ckeditor\CKEditorPluginBase; use Drupal\Component\Utility\NestedArray; +use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; @@ -127,7 +128,8 @@ public function getConfig(Editor $editor) { */ public function getButtons() { $button = function($name, $direction = 'ltr') { - return '' . $name . ''; + $clean_name = str_replace(' ', '', $name); + return SafeMarkup::format('@name', ['@direction' => $direction, '@name' => $name, '@cleanname' => $clean_name]); }; return array( @@ -256,7 +258,7 @@ public function getButtons() { ), 'Format' => array( 'label' => t('HTML block format'), - 'image_alternative' => '' . t('Format') . '', + 'image_alternative' => SafeMarkup::format('@format_text', ['@format_text' => t('Format')]), ), // "table" plugin. 'Table' => array( @@ -282,7 +284,7 @@ public function getButtons() { // No plugin, separator "button" for toolbar builder UI use only. '-' => array( 'label' => t('Separator'), - 'image_alternative' => '', + 'image_alternative' => SafeMarkup::format('', ['@button_separator_text' => t('Button separator')]), 'attributes' => array( 'class' => array('ckeditor-button-separator'), 'data-drupal-ckeditor-type' => 'separator', diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php index d569930..a260702 100644 --- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php @@ -10,6 +10,7 @@ use Drupal\ckeditor\CKEditorPluginBase; use Drupal\ckeditor\CKEditorPluginConfigurableInterface; use Drupal\Component\Utility\NestedArray; +use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Form\FormStateInterface; use Drupal\editor\Entity\Editor; @@ -59,7 +60,7 @@ public function getButtons() { return array( 'Styles' => array( 'label' => t('Font style'), - 'image_alternative' => '' . t('Styles') . '', + 'image_alternative' => SafeMarkup::format('@styles_text', ['@styles_text' => t('Styles')]), ), ); }