Loading
fix: #3402255 Stop double-escaping button labels in CKEditor 5
Description
Embed button labels with special characters (e.g. &) no longer show as HTML entities in CKEditor 5's toolbar tooltips. CKEditor 5 displays button labels as text, so the editor config now passes the label unescaped.
Closes https://git.drupalcode.org/project/entity_embed/-/work_items/3402255
DrupalEntity::getDynamicPluginConfig()passes each button'slabelunescaped;namestays escaped.- New
DrupalEntityCKEditor5PluginTestcovers both. - New
CKEditor5IntegrationTest::testButtonLabelIsText()confirms a label containing HTML shows as text in the button and tooltip, and its script doesn't run.
The labels on the text format's toolbar settings page stay escaped (DrupalEntityDeriver): core's admin UI inserts them as HTML, so they already display correctly there.
Testing instructions
- Edit an embed button (e.g. "Node" at
/admin/config/content/embed/button/manage/node) and set its label toTom & Jerry. - Edit content whose text format has that button in its CKEditor 5 toolbar.
- Hover over the button: the tooltip reads "Tom & Jerry". Before this change it read "Tom & Jerry".
AI disclosure
Claude Code (Claude Opus 5.5) reviewed the fix, wrote the kernel test and drafted this description. I wrote the original fix, confirmed the admin UI's labels must stay escaped, and ran the test locally against the old and new code.
Edited by Dave Reid