Skip to content

Instantly share code, notes, and snippets.

@garryyao
Created October 10, 2011 15:20
Show Gist options
  • Save garryyao/1275587 to your computer and use it in GitHub Desktop.
Save garryyao/1275587 to your computer and use it in GitHub Desktop.
CKEditor custom data filtering
CKEDITOR.replace( 'editor1',
{
on :
{
'pluginsLoaded' : function( evt )
{
// Disallow all heading elements.
evt.editor.dataProcessor.dataFilter.addRules(
{
elements :
{
$ : function( element )
{
if ( /h\d/.exec( element.name ) )
return false;
}
}
} );
}
}
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment