Hi all - when I add classes into the CKEditor5 text editor in my admin, the classes get removed when saving. I believe I need to do something like this but I have been struggling on how exactly to implement it. Do I add it to CKEDITOR_5_CONFIGS in settings.py? Or is there another route to take?
I have been trying to add htmlSupport to CKEDITOR_5_CONFIGS in settings.py but I think I’m getting the syntax wrong as it’s either causing an errror or no error but editor not saving html elements like classes. Below is a simplified version of my current configs. I’ve tried several different combinations of syntax but nothing seems to work.
CKEDITOR_5_CONFIGS = {
'default': {
'toolbar': ['heading', '|', 'bold', 'italic', 'link',
'bulletedList', 'numberedList', 'blockQuote', 'imageUpload', ],
# Allow HTML elements and attributes
'htmlSupport': {
'allow': [
{
'name': '/.*/',
'attributes': True,
'classes': True,
'styles': True
}
]
},
}
}