Ticket #3609: 3609_2.patch
File 3609_2.patch, 2.3 KB (added by , 16 years ago) |
---|
-
_source/core/htmlparser/fragment.js
50 50 /** 51 51 * Creates a {@link CKEDITOR.htmlParser.fragment} from an HTML string. 52 52 * @param {String} fragmentHtml The HTML to be parsed, filling the fragment. 53 * @param {Number} [fixForBody=false] Wrap body with specified element if needed. 53 54 * @returns CKEDITOR.htmlParser.fragment The fragment created. 54 55 * @example 55 56 * var fragment = CKEDITOR.htmlParser.fragment.fromHtml( '<b>Sample</b> Text' ); … … 107 108 108 109 // Create a <p> in the fragment. 109 110 currentNode = target; 110 parser.onTagOpen( 'p', {} );111 parser.onTagOpen( fixForBody, {} ); 111 112 112 113 // The new target now is the <p>. 113 114 target = currentNode; … … 284 285 checkPending(); 285 286 286 287 if ( fixForBody && !currentNode.type ) 287 this.onTagOpen( 'p', {} );288 this.onTagOpen( fixForBody, {} ); 288 289 289 290 currentNode.add( new CKEDITOR.htmlParser.text( text ) ); 290 291 }; … … 311 312 if ( fixForBody && !parent.type && !CKEDITOR.dtd.$body[ node.name ] ) 312 313 { 313 314 currentNode = parent; 314 parser.onTagOpen( 'p', {} );315 parser.onTagOpen( fixForBody, {} ); 315 316 parent = currentNode; 316 317 } 317 318 -
_source/plugins/wysiwygarea/plugin.js
1 /*1 /* 2 2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. 3 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 4 */ … … 404 404 405 405 // Get the HTML version of the data. 406 406 if ( editor.dataProcessor ) 407 data = editor.dataProcessor.toHtml( data, ( editor.config.enterMode != CKEDITOR.ENTER_BR ) ); 407 { 408 var fixForBody = ( editor.config.enterMode != CKEDITOR.ENTER_BR ) 409 ? editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' : false; 410 data = editor.dataProcessor.toHtml( data, fixForBody ); 411 } 408 412 409 413 data = 410 414 editor.config.docType +