I'm at a loss here and hope to get some support from the community.
My config.js contains the following:
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config )
{
config.pasteFromWordPromptCleanup = true;
config.pasteFromWordRemoveFontStyles = true;
config.forcePasteAsPlainText = true;
config.ignoreEmptyParagraph = true;
config.removeFormatAttributes = true;
config.toolbar = 'editor';
config.toolbar_editor =
[
{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
{ name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','Scayt' ] },
{ name: 'insert', items : [ 'Image','Table','HorizontalRule','SpecialChar','PageBreak' ] },
{ name: 'links', items : [ 'Link','Unlink','Anchor' ] },
'/',
{ name: 'styles', items : [ 'Styles','Format' ] },
{ name: 'basicstyles', items : [ 'Bold','Italic','Strike','-','RemoveFormat' ] },
{ name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote' ] },
{ name: 'tools', items : [ 'Maximize','-','About' ] }
];
};
However, I can still add <div style="background-color: black; padding:10px; "> </div> into the post and it show up as a black bar. I'm quite lost at what I'm not doing right.
I did noticed in http://docs.cksource.com/ckeditor_api/s ... onfig.html it says that I should be loading a plugin or something from removeformat. I don't see that in my plugins folder and I can't find it online to install it. Can someone explain what I'm doing wrong!?
Thanks!!!!!
Sun, 12/04/2011 - 21:35
#1
Re: removeFormatAttributes not stripping style=""
You probably misunderstood the feature that you are trying to use (or perhaps I misunderstood your post).
Anyway, the Remove Format feature is described here: http://docs.cksource.com/CKEditor_3.x/U ... ove_Format
All it does is remove the pre-configured format definitions from the text created in CKEditor *when you click the Remove Format button*. It does not magically block certain attributes from entering them into your text.
The removeFormatAttributes configuration setting does not accept a "true" value. See the description from the API:
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
Re: removeFormatAttributes not stripping style=""
Thanks Anna! That's what I was afraid of. I'm definitely using it wrong. Can I force removing format somehow when the form is submitted?
Re: removeFormatAttributes not stripping style=""
You can use the data processor: http://docs.cksource.com/CKEditor_3.x/D ... _Processor
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
Re: removeFormatAttributes not stripping style=""