This module enhances CKEditor 5's handling of semantic HTML definition lists, preventing unwanted transformations of `<dt>` and `<dd>` elements. It ensures that definition lists are preserved correctly during editing and saving, supporting complex structures and attributes.
Features
CKEditor 5 Definition List Fix improves support for semantic HTML definition lists in Drupal's CKEditor 5 integration.
By default, CKEditor 5 may transform or normalize definition list markup in unexpected ways, including:
Converting <dt> elements into paragraphs
Inserting unwanted
tags inside <dt> or <dd>
Altering valid semantic definition list structures during editing
This module provides a lightweight CKEditor 5 plugin that preserves proper definition list markup while editing content.
Features include:
- Preserves
<dl> <dt> Term </dt> <dd> Description </dd> </dl>AND ALSO
<dl> <dt> <p>Term</p> </dt> <dd> Description </dd> </dl>elements in CKEditor 5
- Also preserves
<dl>,<dt>, and<dd>elements in CKEditor 5 - Preserves this markup
<aside class="wb-fnote" role="note"> <h2 id="fn">Note</h2> <dl> <dt>Note 1</dt> <dd id="fn1"> <p>Lorem ipsum quarum</p> <p>Examples:</p> <ul> <li>equipment required</li> <li>an inspection required</li> </ul> <p class="fn-rtn"><a href="#fn1-rf"><span class="wb-inv">Return to footnote </span>1<span class="wb-inv"> referrer</span></a></p> </dd> </dl> </aside> - Prevents unwanted paragraph insertion inside
<dt> - Supports semantic HTML definition lists
- Preserves semantic
<i>elements during editing and saving - Prevents unwanted
<em>from wrapping<i lang="la">et cetera</i>insertion inside<dt>elements - Works directly inside the CKEditor 5 editing experience
- Lightweight implementation with no external libraries required
- Compatible with Drupal 10 and Drupal 11
Typical use cases include:
- Accessibility-focused websites
- Government and enterprise websites
- Technical documentation
- Glossaries and dictionaries
- FAQ layouts using semantic HTML
- Structured editorial content
Post-Installation
After enabling the module:
- Go to:
Administration » Configuration » Content authoring » Text formats and editors - Edit the text format where CKEditor 5 is enabled.
- In the CKEditor 5 toolbar configuration, enable:
Definition List Fix Plugin - Save the text format configuration.
The module works automatically after the plugin is enabled for a text format.
No additional configuration pages are required.
Example supported markup:
<dl>
<dt>Term</dt>
<dd>Description</dd>
</dl>AND
<i lang="la">et cetera</i> (without the em element)
The module is designed to preserve valid semantic definition list markup during editing and saving.
Additional Requirements
No additional modules or external libraries are required.
Requirements:
- Drupal 10 or Drupal 11
- CKEditor 5 (included with Drupal core)
Recommended modules/libraries
The following modules may complement this project depending on your use case:
Documentation
Ask your assistant about CKEditor5 Definition List Fix
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- ckeditor5 Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.