CKEditor does this whenever I add a heading tag:
<h2>
Mai 2010</h2>
How can I remove the new line and spaces after the h2 starting tag, please?
The way to do this without modifying CKEditor's source is to do the following:
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
This is the default CKEDITOR behavior for a lot of tag. To avoid it, open the ckeditor.js file and search for this: n.setRules('title',{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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With