- 🇨🇦Canada amykhailova
Facing the same issue, all elements except spans are being stripped out in summary and span inside span is being stripped out too. Any ideas?
- 🇬🇧United Kingdom jacobupal Leeds
Span-level styles do work within the element, so until this is solved, you can use them to apply bold and italic styling to text within summaries. This is a workaround though, not a permanent solution, which only effects the appearance of the text, not the semantics.
- add a 'bold' and 'italic' style to the Styles config in the CKEditor settings for the Text Format you are using
- use those styles within the element
- apply the bold and italic styling you need with CSS
Example styles:
span.force-bold|Force Bold span.force-italic|Force Italic
Example CSS:
span.force-bold{font-weight:bold!important} span.force-italic{font-style:italic!important}
!important;
is usually not recommended, but personally I think it helps in later identifying which css rules which were hacks that need removing in future. - 🇬🇧United Kingdom jacobupal Leeds
Actually. Ignore everything I said above. The method I wrote works exactly the same as using 'Italic' and 'Bold' buttons.
Neither 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.
- 🇨🇦Canada mandclu
I 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.