CKEditor does this when I add a title tag:
<h2> Mai 2010</h2>
How to remove new line and spaces after h2 start tag?
This is the default CKEDITOR behavior for a large number of tags. To avoid this, open the ckeditor.js file and search for: n.setRules ('name', {indent: false, breakAfterOpen false}); and add this rule: n.setRules ('h2', {indent: false, breakAfterOpen false}); You can add this rule for each tag you want.
The way to do this without changing the source of the CKEditor is as follows:
CKEDITOR.on( 'instanceReady', function( ev ) { ev.editor.dataProcessor.writer.setRules( 'p', { indent : false, breakBeforeOpen : true, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : true }); });
For more information see
http://cksource.com/forums/viewtopic.php?f=6&t=14493 http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Output_Formatting