X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fhtmlwriter%2Fplugin.js;h=5c4a7be25fa906e8b773e015ed4244895877fffb;hp=c0dea03893db3a6b373fac9cb35b52853643bb3a;hb=941b0a9ba4e673e292510d80a5a86806994b8ea6;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d diff --git a/_source/plugins/htmlwriter/plugin.js b/_source/plugins/htmlwriter/plugin.js index c0dea03..5c4a7be 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 :
@@ -262,7 +276,8 @@ CKEDITOR.htmlWriter = CKEDITOR.tools.createClass(
 		 *	
  • breakAfterClose: break line after the closer tag for this element.
  • * * - * All rules default to "false". + * All rules default to "false". Each call to the function overrides + * already present rules, leaving the undefined untouched. * * By default, all elements available in the {@link CKEDITOR.dtd.$block), * {@link CKEDITOR.dtd.$listItem} and {@link CKEDITOR.dtd.$tableContent} @@ -283,7 +298,12 @@ CKEDITOR.htmlWriter = CKEDITOR.tools.createClass( */ setRules : function( tagName, rules ) { - this._.rules[ tagName ] = rules; + var currentRules = this._.rules[ tagName ]; + + if ( currentRules ) + CKEDITOR.tools.extend( currentRules, rules, true ); + else + this._.rules[ tagName ] = rules; } } });