Removing and re-adding source editing loses the list of allowed tags

Created on 14 February 2025, about 2 months ago

Problem/Motivation

If I configure the CKEditor toolbar by removing source editing and then re-adding it, it loses the list of allowed tags.

Steps to reproduce

1. Go to Simplytest.me
2. Create a site in Drupal core 11.x-dev.
3. Go to /admin/config/content/formats/manage/basic_html
4. Note content of fields listing tags.

Result:

Source editing, Manually editable HTML tags contains:
<cite> <dl> <dt> <dd> <a hreflang> <blockquote cite> <ul type> <ol type> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>

Limit allowed HTML tags and correct faulty HTML, Allowed HTML tags contains:
<br> <p> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <cite> <dl> <dt> <dd> <a hreflang href> <blockquote cite> <ul type> <ol start type> <strong> <em> <code> <li> <img src alt data-entity-uuid data-entity-type height width data-caption data-align>

5. Drag the Source editing icon from the Active Toolbar to Available Buttons
6. Drag the Source editing icon from Available Buttons to the Active Toolbar.

Expected result:

Source editing, Manually editable HTML tags contains:
<cite> <dl> <dt> <dd> <a hreflang> <blockquote cite> <ul type> <ol type> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>

Limit allowed HTML tags and correct faulty HTML, Allowed HTML tags contains:
<br> <p> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <cite> <dl> <dt> <dd> <a hreflang href> <blockquote cite> <ul type> <ol start type> <strong> <em> <code> <li> <img src alt data-entity-uuid data-entity-type height width data-caption data-align>

Actual result:

Source editing, Manually editable HTML tags contains a blank field.

Limit allowed HTML tags and correct faulty HTML, Allowed HTML tags contains:
<br> <p> <h2> <h3> <h4> <h5> <h6> <strong> <em> <code> <blockquote> <a href> <ul> <ol start> <li> <img src alt height width data-entity-uuid data-entity-type data-caption data-align>

Proposed resolution

Restore the default that was shown in step 4.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

ckeditor5.module

Created by

πŸ‡ΊπŸ‡ΈUnited States charles belov San Francisco, CA, US

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024