#102559CKEditor: RegExp rules in editor.config.htmlSupport not working
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 CKEReviews 3
Related issues 1
History 47
-
Chris Müller changed parent task #99669 <span data-processor="relativetime" data-value="2023-11-29T18:58:00+00:00" > 11/29/23, 18:58 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 96004 status
NewUnder Review <span data-processor="relativetime" data-value="2026-09-23T16:21:52+00:00" > 09/23/26, 16:21 </span> -
Gerrit Code Review pushed patch set 1 for 14.3 to change 96009 <span data-processor="relativetime" data-value="2026-09-23T17:22:59+00:00" > 09/23/26, 17:22 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 96010 <span data-processor="relativetime" data-value="2026-09-23T17:23:05+00:00" > 09/23/26, 17:23 </span>
-
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-09-23T17:40:11+00:00" > 09/23/26, 17:40 </span>Applied in changeset commit:a90ea1d922c61001c375eeed8dbcac0d6920d881.
FYI: This is fixed with #104827 – I will close this now.
Why it’s already fixed:
- Regexes now work in YAML through a pattern (plus optional flags) object. This was added in #104827 and is documented in Important-104827-AllowToUseRegularExpressionsInCKEditorYAML.rst (12.4.x changelog).
- convertPseudoRegExp() in Build/Sources/TypeScript/rte-ckeditor/ckeditor5.ts:376 converts every {pattern, flags} object into a real RegExp. It runs recursively over the whole htmlSupport config, so name, classes, attributes[].key and styles are all covered.
Your example would be written like this:
htmlSupport: allow: - name: { pattern: '.+' } classes: [ { pattern: 'my-icon-classes.*' } ] attributes: [ { key: { pattern: '^data-.+$' }, value: true } ]I will use this issue now to update our example / Default.yaml.