Ticket #3441: 3441_3.patch
File 3441_3.patch, 2.7 KB (added by , 15 years ago) |
---|
-
_source/plugins/htmlwriter/plugin.js
195 195 * // Writes "Hello Word". 196 196 * writer.text( 'Hello Word' ); 197 197 */ 198 text : function( text )198 text : function( text, isCDATA ) 199 199 { 200 200 if ( this._.indent ) 201 201 { … … 202 202 this.indentation(); 203 203 text = CKEDITOR.tools.ltrim( text ); 204 204 } 205 206 this._.output.push( text ); 205 if ( isCDATA ) 206 this._.output.push( '<![CDATA[', text, ']]>' ); 207 else 208 this._.output.push( text ); 207 209 }, 208 210 209 211 /** -
_source/core/htmlparser/text.js
5 5 6 6 (function() 7 7 { 8 var spacesRegex = /[\t\r\n ]{2,}|[\t\r\n]/g; 8 // cdataNode : Element tag names which contains CDATA data type. 9 var spacesRegex = /[\t\r\n ]{2,}|[\t\r\n]/g, 10 cdataNode = { script : 1, style : 1 }; 9 11 10 12 /** 11 13 * A lightweight representation of HTML text. … … 12 14 * @constructor 13 15 * @example 14 16 */ 15 17 CKEDITOR.htmlParser.text = function( value ) 16 18 { 17 19 /** 18 20 * The text value. … … 44 46 */ 45 47 writeHtml : function( writer, filter ) 46 48 { 47 var text = this.value; 49 var text = this.value, 50 textType = 51 this.parent.name in cdataNode ? 'CDATA' : 'Text'; 48 52 49 if ( filter && !( text = filter .onText(text ) ) )53 if ( filter && !( text = filter[ 'on' + textType ].call( filter, text ) ) ) 50 54 return; 51 55 52 writer.text( text );56 writer.text( text, textType == 'CDATA' ); 53 57 } 54 58 }; 55 59 })(); -
_source/core/htmlparser/filter.js
56 56 { 57 57 return filterName( name, this._.attributeNames ); 58 58 }, 59 59 60 /** 61 * Filtering text node content. 62 * @param {Object} text The text content. 63 */ 60 64 onText : function( text ) 61 65 { 62 66 var textFilter = this._.text; … … 62 66 var textFilter = this._.text; 63 67 return textFilter ? textFilter.filter( text ) : text; 64 68 }, 69 70 /** 71 * Filtering CDATA section content. 72 */ 73 onCDATA : function( cdata ) 74 { 75 var filter = this._.cdata; 76 return filter ? filter.filter( cdata ) : cdata; 77 }, 65 78 66 79 onComment : function( commentText ) 67 80 {