Bug #102488
closedEpic #99669: CKEditor5 Collection
CkEditor on TYPO3 12.4.2 does not allow <i/>-Tag for FontAwesome Glyphs
0%
Description
I've migrated a TYPO3 Site to TYPO3 12.4.2 and I need to preserve the functionality of FontAwesome Glyphs which are in the RTE-HTML.
Existing (migrated) Glyphs are embedded like this:<em class="fa-user-headset far"></em>
The new CkEditor-Plugin I'm trying to use inserts this Markup (but I also could switch it to i):<i class="fa-user-headset far"></i>
What happens:
I've tried to configure CkEditor using YAML to accept that Tag, but nevertheless what I'm trying it's always removed immediately after it has been inserted using either CkEditor-Plugin or manually using HTML-Source editing.
If I'm manually editing this HTML-Markup (using HTML-Source):<i class="fa-user-headset far"> M</i>
The tag immediately removed (after switching back from Source-Edit to RTE-View).
If I'm manually editing this HTML-Markup (using HTML-Source):<i class="fa-user-headset far">X</i>
It results into this, whereas the tag isn't removed, but the class attribute is missing.<i>X</i>
Due to testing to get it working I had this RTE-YAML config settings.
Of course I also switched the RTE-Preset config to use my own sitepackage RTE-Config.
imports: - { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" } - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" } - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" } processing: allowTags: - i allowAttributes - class HTMLparser_db: denyTags = img tags: i: allowedAttribs: ['class']
But all these settings still won't result into a working behaviour. I've been fiddling and researching the internet now for nearly one working day without progress.
Is this a bug or is there missing something in RTE/YAML Configuration?
Updated by Chris Müller 12 months ago
Can you update to the current version (12.4.8)? There were quite some fixes added in this area since 12.4.2. Maybe this is already fixed.
Updated by Gabriel Kaufmann / Typoworx NewMedia 12 months ago
Chris Müller wrote in #note-1:
Can you update to the current version (12.4.8)? There were quite some fixes added in this area since 12.4.2. Maybe this is already fixed.
Thanks for the hint! After the update it worked.
Updated by Gabriel Kaufmann / Typoworx NewMedia 12 months ago · Edited
Gabriel Kaufmann / Typoworx NewMedia wrote in #note-3:
Thanks for the hint! After the update it worked.
Well there's still some culprit. It worked with <i class="fa fa-user">Some Text</i>
which produces non-empty HTML-Tag. But using it like it should be:<i class="fa fa-user"></i>
or even<i class="fa fa-user"> </i>
still doesn't work. It's removed again with html-tag that only has class and no inner-text.
This is my current RTE YAML Config. Is there something missing to allow i-tag without inner-text and class?
editor:
config:
coreStyles_italic:
element: 'i'
overrides: 'span'
processing:
HTMLparser_db:
tags:
i:
allowedAttribs: ['class']
Updated by Wittkiel Gruppe 12 months ago
Gabriel Kaufmann / Typoworx NewMedia wrote in #note-4:
Well there's still some culprit. It worked with
<i class="fa fa-user">Some Text</i>
which produces non-empty HTML-Tag. But using it like it should be:<i class="fa fa-user"></i>
or even<i class="fa fa-user"> </i>
still doesn't work. It's removed again with html-tag that only has class and no inner-text.
This is my current RTE YAML Config. Is there something missing to allow i-tag without inner-text and class?
This works for us:
editor: config: htmlSupport: allowEmpty: - 'i' - 'span' - 'em'
Updated by Gabriel Kaufmann / Typoworx NewMedia 12 months ago
@Wittkiel Gruppe you made my day. That's working!
Additionally I removed this code which doesn't seem to be valid for YAML or at least doesn't seem to be required:
processing: allowTags: - 'i' allowAttributes: - 'aria-hidden' HTMLparser_db: tags: i: allowedAttribs: ['class','aria-hidden']
Updated by Gabriel Kaufmann / Typoworx NewMedia 12 months ago
I think this topic can be closed at this point.