// pair: if the filter_html filter is in use, the CKEditor 5 configuration
// dictates the filter_html's filter plugin's "allowed_html" setting.
// @see ckeditor5_form_filter_format_form_alter()
// @see ::getGeneratedAllowedHtmlValue()
$eventual_editor_and_format =
$this->
getEventualEditorWithPrimedFilterFormat($form_state,
$submitted_editor);
$violations = CKEditor5::
validatePair($eventual_editor_and_format,
$eventual_editor_and_format->
getFilterFormat());
foreach ($violations as $violation) { $property_path_parts =
explode('.',
$violation->
getPropertyPath());
// Special case: AJAX updates that do not submit the form (that cannot
// result in configuration being saved).
if (in_array('editor_form_filter_admin_format_editor_configure',
$form_state->
getSubmitHandlers(), TRUE
)) { // Ensure that plugins' validation constraints do not immediately
// trigger a validation error: the user may choose to configure other
// CKEditor 5 aspects first.
if ($property_path_parts[0
] === 'settings' &&
$property_path_parts[1
] === 'plugins'
) { $plugin_id =
$property_path_parts[2
];
// This CKEditor 5 plugin settings form was just added: the user has
// not yet had a chance to configure it.
if (!
$form_state->
hasValue(['plugins',
$plugin_id])) { continue;
} // This CKEditor 5 plugin settings form was added recently, the user