Index: _source/core/htmlparser/fragment.js
===================================================================
--- _source/core/htmlparser/fragment.js	(revision 3496)
+++ _source/core/htmlparser/fragment.js	Mon Jun 08 10:11:11 CEST 2009
@@ -50,6 +50,7 @@
 	/**
 	 * Creates a {@link CKEDITOR.htmlParser.fragment} from an HTML string.
 	 * @param {String} fragmentHtml The HTML to be parsed, filling the fragment.
+	 * @param {Number} [fixForBody=false] Wrap body with specified element if needed.
 	 * @returns CKEDITOR.htmlParser.fragment The fragment created.
 	 * @example
 	 * var fragment = CKEDITOR.htmlParser.fragment.fromHtml( '<b>Sample</b> Text' );
@@ -107,7 +108,7 @@
 
 				// Create a <p> in the fragment.
 				currentNode = target;
-				parser.onTagOpen( 'p', {} );
+				parser.onTagOpen( fixForBody, {} );
 
 				// The new target now is the <p>.
 				target = currentNode;
@@ -284,7 +285,7 @@
 			checkPending();
 
 			if ( fixForBody && !currentNode.type )
-				this.onTagOpen( 'p', {} );
+				this.onTagOpen( fixForBody, {} );
 
 			currentNode.add( new CKEDITOR.htmlParser.text( text ) );
 		};
@@ -311,7 +312,7 @@
 			if ( fixForBody && !parent.type && !CKEDITOR.dtd.$body[ node.name ] )
 			{
 				currentNode = parent;
-				parser.onTagOpen( 'p', {} );
+				parser.onTagOpen( fixForBody, {} );
 				parent = currentNode;
 			}
 
Index: _source/plugins/wysiwygarea/plugin.js
===================================================================
--- _source/plugins/wysiwygarea/plugin.js	(revision 3549)
+++ _source/plugins/wysiwygarea/plugin.js	Fri Jun 05 12:24:32 CEST 2009
@@ -1,4 +1,4 @@
-﻿/*
+/*
 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
 */
@@ -404,7 +404,11 @@
 
 								// Get the HTML version of the data.
 								if ( editor.dataProcessor )
-									data = editor.dataProcessor.toHtml( data, ( editor.config.enterMode != CKEDITOR.ENTER_BR ) );
+								{
+									var fixForBody = ( editor.config.enterMode != CKEDITOR.ENTER_BR )
+										? editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' : false;
+									data = editor.dataProcessor.toHtml( data, fixForBody );
+								}
 
 								data =
 									editor.config.docType +
