Issue Bug Resolved

#102559CKEditor: RegExp rules in editor.config.htmlSupport not working

Sven Proffe 11/29/23, 16:04 updated 09/23/26, 17:40

Description

According to the docs of CKE/General HTML Support (see: https://ckeditor.com/docs/ckeditor5/latest/api/module_html-support_generalhtmlsupportconfig-GeneralHtmlSupportConfig.html#member-disallow) names, atrribute keys, CSS classes and so on for allow/disallow rules can be declared as regular expressions. Using such values in RTE YAML config files does not work, though (TYPO3 12.4.8). Such values seem to get passed as strings to the editor options and will then not be interpreted correctly by CKE:

editor:
  config:
    htmlSupport:
      allow:
        - {
             name: /.+/,
             classes: [
               /my-icon-classes.*/
             ]
             attributes: [
               { 
                 key: /^data-.+$/, 
                 value: true 
               }
            ]
        }
Expected behaviour: Regular expressions from YAML files in editor.config.htmlSupport.allow or .disallow will work in CKE

Reviews 3