// have valid settings.
// For all already enabled plugins, find the ones that are configurable,
// and add their default settings. For enabled plugins with element
// subsets, compute the appropriate settings to achieve the subset that
// matches the original text format restrictions.
$this->
addDefaultSettingsForEnabledConfigurablePlugins($editor);
$this->
computeSubsetSettingForEnabledPluginsWithSubsets($editor,
$text_format);
} // Add toolbar items based on HTML tags and attributes.
// NOTE: Helper updates $editor->settings by reference and returns info for the message.
$result =
$this->
addToolbarItemsToMatchHtmlElementsInFormat($text_format,
$editor);
if ($result !== NULL
) { [$enabling_message_content,
$enabled_for_attributes_message_content,
$missing,
$plugins_enabled] =
$result;
// Distinguish between unsupported elements covering only tags or not.
$missing_attributes =
new HTMLRestrictions(array_filter($missing->
getAllowedElements()));
$unsupported =
$missing->
diff($missing_attributes);
if ($enabling_message_content) { $this->logger->
info('The CKEditor 5 migration enabled the following plugins to support tags that are allowed by the %text_format text format: %enabling_message_content. The text format must be saved to make these changes active.',
[ '%text_format' =>
$editor->
getFilterFormat()->
get('name'
),