ソース ビューとの間で切り替えると、CKEditor が div CLASS 属性を削除します。
これは構成です:
$('.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("; ")
})
そして、グローバル 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;
};
私は何が欠けていますか?許可されたコンテンツ ルールのドキュメントを読みましたが、何か間違っているようには見えません。ルールを変更してもdiv[*]
、クラスが削除されます。