Come for the code, stay for the community

Investigate CKEditor HTML config

Context

Configuring additional markup in CKEditor can be problematic.

What are the configuration options?

Findings

Using fresh Drupal 11 standard install.

Basic HTML has source editing button, with these editable tags:
<cite> <dl> <dt> <dd> <a hreflang> <blockquote cite> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>

There is no way to apply div style without using source editing to create the div first.

Analysis

The Limit allowed HTML tags and correct faulty HTML filter requires html tags to be enabled.

The Edit source button enables manually editable tags.

Pair these together to allow controlled HTML editing.

Replace Limit allowed HTML tags and correct Faulty HTML with Correct faulty and chopped off HTML if not using editable source to allow creating styles with new html tags.

Follow up

Check out modules that add ckeditor templates to allow manually adding a div.

Modules
Task type
Topics

Subtasks