CKEDitor has been giving me some issues
Whe开发者_如何学Cn I'm trying to add
<p>This is a sample</p>
<p> </p>
<ul>
<li>Example 1</li>
<li>Example 2</li>
</ul>
it adds an extra line for no reason
<p>
This is a sample</p>
<p>
</p>
<ul>
<li>
Example 1</li>
<li>
Example 2</li>
</ul>
How can I fix this?
Look at http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Output_Formatting , especially the part about "breakAfterOpen".
CKEDITOR.replace( 'editor1',
{
on :
{
instanceReady : function( ev )
{
// Output paragraphs as <p>Text</p>.
this.dataProcessor.writer.setRules( 'p',
{
indent : false,
breakBeforeOpen : true,
breakAfterOpen : false,
breakBeforeClose : false,
breakAfterClose : true
});
}
}
});
精彩评论