'format' =>
$text_format->
id(),
// @see \Drupal\editor\Entity\Editor::__construct()
// @see \Drupal\ckeditor5\Plugin\Editor\CKEditor5::getDefaultSettings()
'editor' => 'ckeditor5',
]);
$editor->
setEditor('ckeditor5'
);
$source_editing_additions = HTMLRestrictions::
emptySet();
// Compute the appropriate settings based on the CKEditor 4 configuration
// if it exists.
$old_editor =
$editor->
id() ? Editor::
load($editor->
id()) : NULL;
$old_editor_restrictions =
$old_editor ? HTMLRestrictions::
fromTextFormat($old_editor->
getFilterFormat()) : HTMLRestrictions::
emptySet();
// @todo Remove in https://www.drupal.org/project/drupal/issues/3245351
if ($old_editor) { $editor->
setImageUploadSettings($old_editor->
getImageUploadSettings());
} if ($old_editor &&
$old_editor->
getEditor() === 'ckeditor'
) { [$upgraded_settings,
$messages] =
$this->
createSettingsFromCKEditor4($old_editor->
getSettings(), HTMLRestrictions::
fromTextFormat($old_editor->
getFilterFormat()));
$editor->
setSettings($upgraded_settings);
// *Before* determining which elements are still needed for this text
// format, ensure that all already enabled plugins that are configurable
// have valid settings.
// For all already enabled plugins, find the ones that are configurable,