CKEditor removes CLASS div attributes when switching to / from the original view.
This is the configuration:
$('.cke-editor-restrictive').ckeditor({ extraAllowedContent: [ "*[class,id]", "a[*]", "img[*]", "strong", "em", "small", "u", "s", "i", "b", "p", "blockquote[class,id]", "div[class,id,data-href]", "ul", "ol", "li", "br", "hr", "h1", "h2", "h3", "h4", "h5", "h6", "script[src,charset,async]", "iframe[*]", "embed[*]", "object[*]", "cite", "mark", "time", "dd", "dl", "dt", "table", "th", "tr", "td", "tbody", "thead", "tfoot" ].join("; ") })
And the global configuration of CKEditor:
CKEDITOR.editorConfig = function(config) { config.extraPlugins = 'mediaembed,codemirror,autosave'; config.codemirror = { ... }; config.toolbar = [['Bold', 'Italic', 'Underline', "RemoveFormat"], ['NumberedList', 'BulletedList', 'Blockquote'], ['Link', 'Unlink', 'Image', 'MediaEmbed'], ['Find', 'Paste'], ['Source', 'Maximize']]; config.bodyClass = 'ckeditor-body'; config.contentsCss = "/assets/application.css"; config.baseHref = "http://www.website.org/"; config.forcePasteAsPlainText = true; };
What am I missing? I was over the documentation for valid content rules , and it doesn't look like I'm doing something wrong. Even if I change the rule to div[*]
, it will delete the class.