Ticket #3153: 3153.patch
File 3153.patch, 4.1 KB (added by , 15 years ago) |
---|
-
_source/core/dtd.js
52 52 O = X({param:1},K), 53 53 P = X({form:1},A,D,E,I), 54 54 Q = {li:1}; 55 56 var block = {address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1}; 55 57 56 58 return /** @lends CKEDITOR.dtd */ { 57 59 … … 62 64 * @type Object 63 65 * @example 64 66 */ 65 $block : {address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1},67 $block : block, 66 68 69 $body : X({script:1}, block), 70 67 71 /** 68 72 * List of empty (self-closing) elements, like "br" or "img". 69 73 * @type Object -
_source/core/htmlparser/fragment.js
50 50 * alert( fragment.children[0].name ); "b" 51 51 * alert( fragment.children[1].value ); " Text" 52 52 */ 53 CKEDITOR.htmlParser.fragment.fromHtml = function( fragmentHtml )53 CKEDITOR.htmlParser.fragment.fromHtml = function( fragmentHtml, fixForBody ) 54 54 { 55 55 var parser = new CKEDITOR.htmlParser(), 56 56 html = [], … … 90 90 91 91 parser.onTagOpen = function( tagName, attributes, selfClosing ) 92 92 { 93 if ( fixForBody && !currentNode.type && !CKEDITOR.dtd.$body[ tagName ] ) 94 this.onTagOpen( 'p', {} ); 95 93 96 var element = new CKEDITOR.htmlParser.element( tagName, attributes ); 94 97 95 98 // "isEmpty" will be always "false" for unknown elements, so we … … 208 211 } 209 212 210 213 checkPending(); 214 215 if ( fixForBody && !currentNode.type ) 216 this.onTagOpen( 'p', {} ); 217 211 218 currentNode.add( new CKEDITOR.htmlParser.text( text ) ); 212 219 }; 213 220 -
_source/plugins/htmldataprocessor/plugin.js
124 124 125 125 CKEDITOR.htmlDataProcessor.prototype = 126 126 { 127 toHtml : function( data )127 toHtml : function( data, fixForBody ) 128 128 { 129 129 // The source data is already HTML, but we need to clean 130 130 // it up and apply the filter. … … 141 141 142 142 // Now use our parser to make further fixes to the structure, as 143 143 // well as apply the filter. 144 var fragment = CKEDITOR.htmlParser.fragment.fromHtml( div.innerHTML ),144 var fragment = CKEDITOR.htmlParser.fragment.fromHtml( div.innerHTML, fixForBody ), 145 145 writer = new CKEDITOR.htmlParser.basicWriter(); 146 146 147 147 fragment.writeHtml( writer, this.dataFilter ); … … 149 149 return writer.getHtml( true ); 150 150 }, 151 151 152 toDataFormat : function( html )152 toDataFormat : function( html, fixForBody ) 153 153 { 154 154 var writer = this.writer, 155 fragment = CKEDITOR.htmlParser.fragment.fromHtml( html );155 fragment = CKEDITOR.htmlParser.fragment.fromHtml( html, fixForBody ); 156 156 157 157 writer.reset(); 158 158 -
_source/plugins/wysiwygarea/plugin.js
289 289 290 290 // Get the HTML version of the data. 291 291 if ( editor.dataProcessor ) 292 data = editor.dataProcessor.toHtml( data );292 data = editor.dataProcessor.toHtml( data, ( editor.config.enterMode != CKEDITOR.ENTER_BR ) ); 293 293 294 294 data = 295 295 editor.config.docType + … … 339 339 var data = iframe.$.contentWindow.document.body.innerHTML; 340 340 341 341 if ( editor.dataProcessor ) 342 data = editor.dataProcessor.toDataFormat( data );342 data = editor.dataProcessor.toDataFormat( data, ( editor.config.enterMode != CKEDITOR.ENTER_BR ) ); 343 343 344 344 return data; 345 345 },