Index: _source/plugins/list/plugin.js
===================================================================
--- _source/plugins/list/plugin.js	(revision 5456)
+++ _source/plugins/list/plugin.js	(revision )
@@ -288,22 +288,22 @@
 			var contentBlock = listContents.shift(),
 				listItem = doc.createElement( 'li' );
 
-			// Preserve heading structure when converting to list item. (#5271)
-			if ( headerTagRegex.test( contentBlock.getName() ) )
+			// Preserve preformat block and heading structure when converting to list item. (#5335) (#5271)
+			if ( contentBlock.is( 'pre' ) || headerTagRegex.test( contentBlock.getName() ) )
 				contentBlock.appendTo( listItem );
 			else
 			{
 				contentBlock.copyAttributes( listItem );
 				contentBlock.moveChildren( listItem );
 				contentBlock.remove();
-			}
 
-			listItem.appendTo( listNode );
-
-			// Append a bogus BR to force the LI to render at full height
-			if ( !CKEDITOR.env.ie )
-				listItem.appendBogus();
-		}
+				// Append a bogus BR to force the LI to render at full height
+				if ( !CKEDITOR.env.ie )
+					listItem.appendBogus();
+			}
+
+			listItem.appendTo( listNode );
+		}
 		if ( insertAnchor )
 			listNode.insertBefore( insertAnchor );
 		else
Index: _source/plugins/domiterator/plugin.js
===================================================================
--- _source/plugins/domiterator/plugin.js	(revision 5206)
+++ _source/plugins/domiterator/plugin.js	(revision )
@@ -44,6 +44,9 @@
 			// Indicats that the current element in the loop is the last one.
 			var isLast;
 
+			// Indicate at least one of the range boundaries is inside a preformat block.
+			var touchPre;
+
 			// Instructs to cleanup remaining BRs.
 			var removePreviousBr, removeLastBr;
 
@@ -51,7 +54,11 @@
 			if ( !this._.lastNode )
 			{
 				range = this.range.clone();
-				range.enlarge( this.forceBrBreak || !this.enlargeBr ?
+
+				touchPre = range.endContainer.hasAscendant( 'pre', true )
+					|| range.startContainer.hasAscendant( 'pre', true );
+
+				range.enlarge( this.forceBrBreak && !touchPre || !this.enlargeBr ?
 							   CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS );
 
 				var walker = new CKEDITOR.dom.walker( range ),
@@ -102,7 +109,8 @@
 			{
 				// closeRange indicates that a paragraph boundary has been found,
 				// so the range can be closed.
-				var closeRange = false;
+				var closeRange = false,
+						parentPre = currentNode.hasAscendant( 'pre' );
 
 				// includeNode indicates that the current node is good to be part
 				// of the range. By default, any non-element node is ok for it.
@@ -115,7 +123,8 @@
 				{
 					var nodeName = currentNode.getName();
 
-					if ( currentNode.isBlockBoundary( this.forceBrBreak && { br : 1 } ) )
+					if ( currentNode.isBlockBoundary( this.forceBrBreak &&
+							!parentPre && { br : 1 } ) )
 					{
 						// <br> boundaries must be part of the range. It will
 						// happen only if ForceBrBreak.
@@ -189,7 +198,8 @@
 					{
 						var parentNode = currentNode.getParent();
 
-						if ( parentNode.isBlockBoundary( this.forceBrBreak && { br : 1 } ) )
+						if ( parentNode.isBlockBoundary( this.forceBrBreak
+								&& !parentPre && { br : 1 } ) )
 						{
 							closeRange = true;
 							isLast = isLast || ( parentNode.equals( lastNode) );
