/**
* {@inheritdoc}
*/
public function getCKEditor5PluginConfig(EditorInterface
$editor): array
{ $definitions =
$this->
getEnabledDefinitions($editor);
// Allow plugin to modify config, such as loading dynamic values.
$config =
[];
foreach ($definitions as $plugin_id =>
$definition) { $plugin =
$this->
getPlugin($plugin_id,
$editor);
$config[$plugin_id] =
$plugin->
getDynamicPluginConfig($definition->
getCKEditor5Config(),
$editor);
} // CKEditor 5 interprets wildcards from a "CKEditor 5 model element"
// perspective, Drupal interprets wildcards from a "HTML element"
// perspective. GHS is used to reconcile those two perspectives, to ensure
// all expected HTML elements truly are supported.
// The `ckeditor5_wildcardHtmlSupport` is automatically enabled when
// necessary, and only when necessary.
// @see \Drupal\ckeditor5\Plugin\CKEditor5PluginManager::getEnabledDefinitions()
if (isset($definitions['ckeditor5_wildcardHtmlSupport'
])) { $allowed_elements =
new HTMLRestrictions($this->
getProvidedElements(array_keys($definitions),
$editor, FALSE
));