Closed (fixed)
Project:
CKeditor Details Accordion
Version:
2.1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Mar 2022 at 09:19 UTC
Updated:
2 Jul 2026 at 14:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
amykhailova commentedFacing the same issue, all elements except spans are being stripped out in summary and span inside span is being stripped out too. Any ideas?
Comment #3
jacobupal commented[deleted my earlier suggestion]
Comment #4
jacobupal commentedNeither button (for me) will apply to selected text, but both of them do create an empty
<strong>or<em>element at the end of the summary. This is removed if you switch to source view. But if you click the 'Bold' icon and start typing right away you do get some bold text at the end of the summary.Incidentally keyboard shortcuts Ctrl+i and Ctrl+b do both work as expected.
Comment #5
mandclu commentedI can also verify the problem. In fact, the CKEditor4 version of this plugin explicitly allowed for media and images inside the summary, since the HTML spec for the summary element allows for any phrasing content (or one element of heading content, but with accessibility problems).
In the conversion of the plugin to work with CKEditor5, I missed the fact that the allowedContent configuration option was dropped from CKEditor5. It sounds like the way to make this work is by creating a plugin that will extend the editor's General HTML support. There's more information available in the CKE documentation.
Comment #6
maursilveira commentedHello all,
Has anybody found a solution for this? Having the same issue with some CKEditor plugins that don't really have keyboard shortcuts, such as font colours provided by CKEditor 5 Plugin Pack.
I'm wondering if it's possible to apply the same structure/configuration from the ".details-wrapper" to the summary, since styling and functionalities provided by other CKEditor plugins work correctly on text within the content wrapper.
Comment #8
maursilveira commentedHello,
After some investigation and attempts, I found out that the
blurevent in the function_addEventListeners()in the filejs/ckeditor5_plugins/detail/src/detailediting.jsis replacing the whole text in the summary with it own on eachblurevent, which happens when we click on any format buttons in CKEditor (e.g. Italic). This is causing the removal of the text selection, meaning the format won't be applied because there is no text selected anymore. This is caused by a functionality to remove (technically, it's replacing it with an empty string) all zero-width spaces from the summary, which happens on each blur event, no matter if there's any occurrence of that character in the summary or not.I added an if statement to make sure the replacement only happens if a ZWSP is found in the summary. This will cause the formatting not being added in the very first attempt, when the ZWSP is removed, but it will work after that (unless a new ZWSP is added). I acknowledge this will cause this glitch when a ZWSP is added, but that seems to be a very edge case. This solution can definitely be improved, but I believe, for now, this is a quite decent fix to resolve this issue for the vast majority of the situations.
I created a MR with the fix, and I'm also uploading a patch file in case someone needs it.
Please let me know if you have any questions. Thank you.
Comment #9
roshanibhangale commentedHi
I have tested issue on Drupal 2.x-dev
Testing steps:
After applied MR, the Help link is redirecting to the help page correctly.
Attaching screenshot
Moving to RTBC+1
Comment #10
roshanibhangale commentedComment #14
liam morlandThanks!
Comment #16
liam morland