Skip to content

Make the CKEditor GeneralHtmlSupport allow list configurable (#5897) - #5900

Open
Lucsaan wants to merge 2 commits into
RotherOSS:rel-11_1from
Lucsaan:issue-#5897-richtext-htmlsupport-config
Open

Make the CKEditor GeneralHtmlSupport allow list configurable (#5897)#5900
Lucsaan wants to merge 2 commits into
RotherOSS:rel-11_1from
Lucsaan:issue-#5897-richtext-htmlsupport-config

Conversation

@Lucsaan

@Lucsaan Lucsaan commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Resolves #5897

Summary

The htmlSupport (GeneralHtmlSupport) allow list of the RichText editor was hardcoded in Core.UI.RichTextEditor.js (span, cite, style, table). Attributes, classes and inline styles on any other element that no active editor feature handles are silently stripped — e.g. a border style on an image does not survive a round-trip, a regression compared to CKEditor 4, and there is no configuration to change it.

This change moves the element list to SysConfig:

  • Frontend::RichText::HtmlSupportAllowedElements (agent interface)
  • CustomerFrontend::RichText::HtmlSupportAllowedElements (customer interface)

Both default to span, cite, style, table, so standard installations keep exactly today's filtering. Layout.pm passes the list through the existing RichText JS data; Core.UI.RichTextEditor.js builds the allow array from it (with the previous values as fallback when the setting is absent).

Example

An administrator who wants image styles to survive (e.g. borders) adds img to the list — no code change needed.

Backport

The same problem exists on rel-11_0; a backport PR against rel-11_0 follows.

The htmlSupport allow list was hardcoded in Core.UI.RichTextEditor.js
(span, cite, style, table). Everything else loses attributes, classes and
inline styles that no active editor feature handles — for example a border
style on an image is silently stripped, with no way to change that from
the outside.

Move the element list to the new SysConfig settings
Frontend::RichText::HtmlSupportAllowedElements and
CustomerFrontend::RichText::HtmlSupportAllowedElements (default keeps the
current behavior) and pass it to the editor via the RichText JS data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CKEditor 5: GeneralHtmlSupport allow list is hardcoded, stripping e.g. image border styles

1 participant