JSFiddle - React, Tailwind, and code Playground
by Comandeer
HTML
<script src="https://cdn.ckeditor.com/4.5.7/basic/ckeditor.js"></script>
<div id="editor1">
<p>Test <span style="color: rgb( 255, 0, 0 );">remove</span></p>
</div>
JavaScript
CKEDITOR.replace( 'editor1', {
allowedContent: true,
toolbar: [
[ 'TestCmd' ]
],
on: {
configLoaded: function( evt ) {
evt.editor.ui.addButton( 'TestCmd', {
label: 'Test',
command: 'testCmd'
} );
evt.editor.addCommand( 'testCmd', {
exec: function( editor, data) {
var style = new CKEDITOR.style( {
element: 'span',
styles: {
color: '#f00'
},
type: CKEDITOR.STYLE_INLINE
} );
style.remove( editor );
}
} )
}
}
} );