Issue #3261943 by bnjmnm, lauriii, Wim Leers, andreasderijcke, ifrik:...
Issue #3261943 by bnjmnm, lauriii, Wim Leers, andreasderijcke, ifrik: Confusing behavior after pressing "Apply changes to allowed tags" with invalid value
(cherry picked from commit 7067f98b)
'Switching to CKEditor 5 requires, at minimum, the tags "<p> <br>". After switching to CKEditor 5, this field will be read-only, and will be updated based on which CKEditor 5 plugins are enabled. When switching to CKEditor 5 from an existing text format with content, we recommend documenting what tags are in use and then enabling the CKEditor 5 plugins that support them.',
// In this very specific use case, submitting the filter form must
// be prevented.
// - CKEditor 5 is the selected editor, but it's not yet accepted
// by the form because it's not passing the validation restraint
// requiring CKEditor 5 compatible "Allowed Tags". This validator,
// by necessity fires before CKEditor 5 is registered with the
// form.
// - The registering of an editor with the form typically occurs
// when a change
formSubmit.setAttribute('disabled',true);
constformSubmitHelp=document.createElement('p');
formSubmitHelp.setAttribute(
'data-ckeditor5-allowed-tags-disabled-help',
true,
);
formSubmitHelp.textContent=Drupal.t(
'This form is not submittable when the editor is set to CKEditor 5 unless the "Limit allowed HTML tags and correct faulty HTML" filter\'s "Allowed HTML tags" field includes the tags required by CKEditor 5',
description.innerText=Drupal.t('Switching to CKEditor 5 requires, at minimum, the tags "<p> <br>". After switching to CKEditor 5, this field will be read-only, and will be updated based on which CKEditor 5 plugins are enabled. When switching to CKEditor 5 from an existing text format with content, we recommend documenting what tags are in use and then enabling the CKEditor 5 plugins that support them.');
formSubmitHelp.textContent=Drupal.t('This form is not submittable when the editor is set to CKEditor 5 unless the "Limit allowed HTML tags and correct faulty HTML" filter\'s "Allowed HTML tags" field includes the tags required by CKEditor 5');