DJANGO-CMS PlaholderFields CKEDITOR TEXT_HTML_SANITIZE

231 Views Asked by At

I've implemented a PlaceholderField outside my CMS and it works fine but Text copied from MS-Word keeps all dirty markup (like <font face="Times New Roman, serif"><font size="3">) which I want to get rid of. When I copy the same Text in a normal CKEditor field it works as explained in djangocms-text-ckeditor source (settings.TEXT_HTML_SANITIZE using html5lib).

Is there a parameter I can add to settings.CMS_PLACEHOLDER_CONF in order to make it work? Or any idea to implement it?

You may ask "Why not using directly HTMLField with djangocms-text-ckeditor?" Because I want to have access to Filer-File and Filer-Image plugins available in PlaceholderField.

1

There are 1 best solutions below

0
On

The following setting is not part of the placeholder config, they are separate settings in the settings.py file:

TEXT_HTML_SANITIZE = True

CKEDITOR_SETTINGS = {
    ...
    'basicEntities': True,
    'entities': True,
    ...
}

Taken from: https://github.com/django-cms/djangocms-text-ckeditor#configurable-sanitizer