Reputation: 8495
Does anyone know how to get the advancedContentFilter working in the django-ckeditor config settings? Im trying to filter pasted in p tags to remove style attributes. Im using the following in settings.py but it does'nt seem to register.
CKEDITOR_CONFIGS = {
'allowedContent':'p',
}
Upvotes: 4
Views: 3094
Reputation: 371
Django CKEditor
you can add or remove tag according to your need,
and do True False which you want (attributes, styles, classes)
https://django-ckeditor.readthedocs.io/en/latest/#if-you-want-to-use-allowedcontent
CKEDITOR_CONFIGS = {
'default': {
'removePlugins': 'stylesheetparser',
'allowedContent': True,
'allowedContent':{'ul div section ol a p ':{
'attributes': True,
'styles': True,
'classes': False
},
},
......
.......
......
}
}
Upvotes: 0
Reputation: 61
This works for me
CKEDITOR_CONFIGS = {
'default': {
'removePlugins': 'stylesheetparser',
'allowedContent': True,
},
}
Upvotes: 6
Reputation: 748
CKEDITOR_CONFIGS is a dictionary of configs, not a config dictionary :D try:
CKEDITOR_CONFIGS = {
'default': {
'allowedContent':'p',
},
}
Upvotes: 1
Reputation: 3294
Have you tried to remove stylesheetparser
plugin?
https://github.com/shaunsephton/django-ckeditor#if-you-want-to-use-allowedcontent
Upvotes: 0