| 33 | |
| 34 | |
| 35 | var tempData = evt.data; |
| 36 | |
| 37 | if ( this.dataProcessor ) |
| 38 | tempData = this.dataProcessor.toHtml( tempData ); |
| 39 | |
| 40 | tempData = CKEDITOR.dom.element.createFromHtml(tempData) ; |
| 41 | |
| 42 | // For not applying this fix on Text node. |
| 43 | if(tempData.type != CKEDITOR.NODE_TEXT){ |
| 44 | |
| 45 | var elementName = tempData.getName(); |
| 46 | var isBlock = CKEDITOR.dtd.$block[ elementName ]; |
| 47 | |
| 48 | // Also don't apply the fix if the inserting HTML is not a block. |
| 49 | if(isBlock){ |
| 50 | |
| 51 | this.fire( 'insertElement', CKEDITOR.dom.element.createFromHtml('<div>'+evt.data+'</div>') ); |
| 52 | return; |
| 53 | |
| 54 | } |
| 55 | } |
| 56 | |