typo3ckeditor5typo3-12.x

How to allow custom HTML tags in the CKEditor 5 of TYPO3 12?


According to the changelog, the CKEditor 5 plugin "GeneralHTMLSupport" is available in TYPO3 12. I guess it can be activated in the own editor configuration (yaml):

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' }

editor:
  config:
    ???

Unfortunately, the examples from the CKEditor 5 documentary, like …

htmlSupport: {
    allow: [
        {
            name: 'div',
            classes: true
        }
    ]
}

… does not work here.

How can I allow <div class="xyz">…</div> in the RTE, for example?

Addendum: As I have just learned, it cannot work at all yet due to the bug https://forge.typo3.org/issues/100861. Nevertheless, I would be interested to know how to configure it after the bug fix is implemented.


Solution

  • As David mentioned in the comment above, it now works since TYPO3 version 12.4.7. as described in the docu:

    EXT:my_sitepackage/Configuration/RTE/MyPreset.yaml

    # Allow the <iframe> tag with all attributes, all classes and all styles:
    RTE:
      config:
        htmlSupport:
          allow:
            - { name: 'iframe', attributes: true, classes: true, styles: true }