Thanks @CozyDrupal. New release includes a schema.
Minor info.yml change incorporated in new module version 4.1.4
Thanks for correcting me. I was under the wrong impression, or may be I had tested a D10 version with a fix 🐛 TypeError: Drupal\ckeditor5\HTMLRestrictions::__construct(): Argument #1 ($elements) must be of type array, Drupal\ckeditor5\HTMLRestrictions given Needs work . The issue does occur in current and dev releases of D10. In my opinion, it is still primarily a core/CKEditor issue with handling of filter modules, as discussed elsewhere 🐛 TypeError: Drupal\ckeditor5\HTMLRestrictions::__construct(): Argument #1 ($elements) must be of type array, Drupal\ckeditor5\HTMLRestrictions given Needs work .
I cannot change the module filter type to something other than TYPE_HTML_RESTRICTOR.
As you noted, implementing getHTMLRestrictions in the htmLawed module is difficult because htmLawed has a different filtering customization and may be more complex filtering ability than Drupal/CKEditor (e.g., regex patterns to indicate permissibility of attribute values). Correctly conveying this through getHTMLRestrictions() may not be not possible .
Just noting that this issue occurs 🐛 Error message The current CKEditor 5 build requires the following elements and attributes Closed: won't fix with the htmLawed text filter module (TYPE_HTML_RESTRICTOR) in D9 but not D10.
As noted elsewhere 🐛 TypeError: Argument 1 passed to Drupal\ckeditor5\HTMLRestrictions::__construct() must be of the type array, object given Closed: works as designed , the CKEditor5 issue doesn't occur in D10 but occurs in D9. It seems CKEditor5 devs are trying 🐛 TypeError: Drupal\ckeditor5\HTMLRestrictions::__construct(): Argument #1 ($elements) must be of type array, Drupal\ckeditor5\HTMLRestrictions given Needs work to get a fix for D9. I guess we just have to wait for that. For those who need an immediate fix, perhaps the suggested patch will work well.
Thank you for looking into the issue to identify its cause and also note possible fixes along with their drawbacks.
htmLawed is functionally TYPE_HTML_RESTRICTOR, and while making it TYPE_TRANSFORM_IRREVERSIBLE will fix this CKEditor issue, I don't know what issues will arise from the change.
I think it is better to open an issue with CKEditor devs to change their code logic.
I am closing this issue, which is a CKEditor 5 issue 🐛 TypeError: Drupal\ckeditor5\HTMLRestrictions::__construct(): Argument #1 ($elements) must be of type array, Drupal\ckeditor5\HTMLRestrictions given Needs work with Drupal 9 that the CKEditor developers are trying to fix.
Thanks for reporting this issue. I can confirm that it occurs with both an old and freshly installed Drupal 9.5+ installation. Such issue doesn't occur with another Drupal text filter module that I tested (Twigs). In my setup, the message I see is:
Error message
The current CKEditor 5 build requires the following elements and attributes:
<br> <p> <h2> <h3> <h4> <h5> <h6> <strong> <em>
The following elements are missing:
<br> <p> <h2> <h3> <h4> <h5> <h6> <strong> <em>
The issue doesn't occur in Drupal 10 (htmLawed module code same as Drupal 9), making me wonder if the issue is in Drupal 9 or its CKEditor code.
OK. So, after removing 'style' from 'deny_attribute', you are still not able to use CKEditor's style. But, without using CKEditor, can you input HTML text with 'style'? E.g., some text like <span style='color: black'>test</span>
. Can you check? What I am saying is: Is the issue in CKEditor and not htmLawed?
Try removing 'style' from the 'deny_attribute' parameter of htmLawed setting.
The htmLawed module's default setting is to use htmLawed in 'safe' mode (see documentation → ). This prevents use of the 'style' attribute. Perhaps this is the cause of the issue.