X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fplugins%2Fhtmlwriter%2Fplugin.js;h=46faddec28f865127cc1fb40dfc7da9d93ad60f1;hb=refs%2Ftags%2Fv3.3.2;hp=c0dea03893db3a6b373fac9cb35b52853643bb3a;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/plugins/htmlwriter/plugin.js b/_source/plugins/htmlwriter/plugin.js index c0dea03..46fadde 100644 --- a/_source/plugins/htmlwriter/plugin.js +++ b/_source/plugins/htmlwriter/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -67,7 +67,7 @@ CKEDITOR.htmlWriter = CKEDITOR.tools.createClass( var dtd = CKEDITOR.dtd; - for ( var e in CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, dtd.$tableContent ) ) + for ( var e in CKEDITOR.tools.extend( {}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent ) ) { this.setRules( e, { @@ -78,15 +78,29 @@ CKEDITOR.htmlWriter = CKEDITOR.tools.createClass( breakAfterClose : true }); } + this.setRules( 'br', { breakAfterOpen : true }); + + this.setRules( 'title', + { + indent : false, + breakAfterOpen : false + }); + + this.setRules( 'style', + { + indent : false, + breakBeforeClose : true + }); + // Disable indentation on
. this.setRules( 'pre', - { - indent: false - } ); + { + indent: false + }); }, proto : @@ -157,8 +171,13 @@ CKEDITOR.htmlWriter = CKEDITOR.tools.createClass( */ attribute : function( attName, attValue ) { - if ( this.forceSimpleAmpersand ) - attValue = attValue.replace( /&/, '&' ); + + if ( typeof attValue == 'string' ) + { + this.forceSimpleAmpersand && ( attValue = attValue.replace( /&/g, '&' ) ); + // Browsers don't always escape special character in attribute values. (#4683, #4719). + attValue = CKEDITOR.tools.htmlEncodeAttr( attValue ); + } this._.output.push( ' ', attName, '="', attValue, '"' ); }, @@ -262,7 +281,8 @@ CKEDITOR.htmlWriter = CKEDITOR.tools.createClass( *