This project is not covered by Drupal’s security advisory policy.

Note that new version 1.2.x-dev is now available and solves all issues that have been experienced with Drupal 10.2. This is now the recommended release for all versions of Drupal.

This module provides a filter for CKEditor 5 that allows the administrator to manually define an allowed list of HTML tags when using the 'Limit allowed HTML tags' filter in a text format.
This is basically reinstating the functionality that we had in CKEditor 4 and may thus be very useful for anyone who is migrating a site from CKEditor 4.
When first installing Drupal 10 and the associated CKEditor 5 one of the first things that I noticed was that when I selected the 'Limit allowed HTML tags' filter in my text format the list of 'Allowed HTML tags' had become a readonly field. In our previous Drupal 9 / CKEditor 4 sites we had quite an extensive list of tags and attributes that were allowed and our editors were very keen to retain this functionality in Drupal 10. Reading the documentation told me that the solution was to write new CKEditor plugins to support the extra tags/attributes but these struck me as an unnecessary amount of work.
I have therefore created this module to contain a new filter that is a copy of the 'Limit allowed HTML tags' filter in all ways apart from the fact that the list of 'Allowed HTML tags' is an editable field.

To make use of this module follow these steps:

  • Install the module
  • Edit a text format at /admin/config/content/formats
  • From the list of filters make sure that you select 'Limit allowed HTML tags and correct faulty HTML - Editable tag list' rather than the original 'Limit allowed HTML tags and correct faulty HTML'
  • Scroll down the page and select the 'Limit allowed HTML tags and correct faulty HTML - Editable tag list' tab /li>
  • You will now be able to edit the 'Allowed HTML tags' list to allow any tags/attributes that you require

Note that by installing this filter you are taking full responsibility for manually maintaining the list of HTML tags that are required. If you had installed the original (core provided) 'Limit allowed HTML tags and correct faulty HTML' filter then the list of allowed tags would have been automatically maintained by JQuery so that tags would be dynamically added and removed as you enabled filters and added buttons to the toolbar. If you are going to go ahead and use this filter then it may be a good idea to temporarily install the original filter in order to see the list of HTML tags that it recommends with your current toolbar configuration - you can then disable the original filter and paste the list into this filter along with any extra tags/attributes that you require.

Project information

Releases