- var newBlock = getElement( this, doc, block );\r
- replaceBlock( block, newBlock );\r
+ if ( !block.isReadOnly() )\r
+ {\r
+ var newBlock = getElement( this, doc, block );\r
+ replaceBlock( block, newBlock );\r
+ }\r
+ }\r
+\r
+ range.moveToBookmark( bookmark );\r
+ }\r
+\r
+ function removeBlockStyle( range )\r
+ {\r
+ // Serializible bookmarks is needed here since\r
+ // elements may be merged.\r
+ var bookmark = range.createBookmark( 1 );\r
+\r
+ var iterator = range.createIterator();\r
+ iterator.enforceRealBlocks = true;\r
+ iterator.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR;\r
+\r
+ var block;\r
+ while ( ( block = iterator.getNextParagraph() ) )\r
+ {\r
+ if ( this.checkElementRemovable( block ) )\r
+ {\r
+ // <pre> get special treatment.\r
+ if ( block.is( 'pre' ) )\r
+ {\r
+ var newBlock = this._.enterMode == CKEDITOR.ENTER_BR ?\r
+ null : range.document.createElement(\r
+ this._.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' );\r
+\r
+ newBlock && block.copyAttributes( newBlock );\r
+ replaceBlock( block, newBlock );\r
+ }\r
+ else\r
+ removeFromElement( this, block, 1 );\r
+ }\r