I have a plugin to insert a <cut /> into text. It works fine, the result is expected, but in the editor window <cut /> converted to <cut></cut> , wraps the paragraphs below and prevents further changes.
GIF - http://gyazo.com/dd7c36ba7cb7bc7cb00186cfb83e5fbc
Any ideas how to fix this?
CKEDITOR.plugins.add('pagecut', { lang: 'de,en,ru', onLoad: function(){ var css = ('display:block;clear:both;width:100%;border-top:#999 1px dotted;padding:0;height:1px;cursor:default;'); var cssBefore = ( 'content:"";' + 'background: url(' + CKEDITOR.getUrl( this.path + 'images/image.png' ) + ') no-repeat right center;' + 'height:14px;width:25px;position:relative;display:block;top:-8px;float:right;' ); CKEDITOR.addCss( 'cut{' + css + '} cut:before{' + cssBefore + '}' ); }, init: function(editor) { CKEDITOR.dtd['cut'] = {}; CKEDITOR.dtd.$empty['cut'] = 1; CKEDITOR.dtd.$nonEditable['cut'] = 1; CKEDITOR.dtd.$object['cut'] = 1; editor.addCommand('insertPagecut', { exec: function(editor) { var element = CKEDITOR.dom.element.createFromHtml('<cut />'); editor.insertElement(element); } }); editor.ui.addButton('Pagecut', { label: editor.lang.pagecut.toolbar, command: 'insertPagecut', icon: this.path + 'images/icon.png', toolbar: 'links' }); } });
source share