code: function replaceBlock( block, newBlock ) {
  		// Block is to be removed, create a temp element to
  		// save contents.
  		var removeBlock = !newBlock;
  		if ( removeBlock ) {
  			newBlock = block.getDocument().createElement( 'div' );
  			block.copyAttributes( newBlock );
  		}
  
  		var newBlockIsPre = newBlock && newBlock.is( 'pre' ),
  			blockIsPre = block.is( 'pre' ),
  			isToPre = newBlockIsPre && !blockIsPre,
  			isFromPre = !newBlockIsPre && blockIsPre;
  
  		if ( isToPre )
  			newBlock = toPre( block, newBlock );
  		else if ( isFromPre )
  			// Split big <pre> into pieces before start to convert.
  			newBlock = fromPres( removeBlock ? [ block.getHtml() ] : splitIntoPres( block ), newBlock );
  		else
  			block.moveChildren( newBlock );
  
  		newBlock.replace( block );
  
  		if ( newBlockIsPre ) {
  			// Merge previous <pre> blocks.
  			mergePre( newBlock );
  		} else if ( removeBlock ) {
  			removeNoAttribsElement( newBlock );
  		}
  	}
docs: Replace the original block with new one, with special treatment for <pre> blocks to make sure content format is well preserved, and merging/splitting adjacent when necessary. (#3188)