Reputation: 1083
I am setting the input to CKEditor from back-end. When i give an set of paragraph values, it automatically inserting the <p> </p>
. How can i avoid this insertion of tag.
<p>A wolf wants to eat the girl but is afraid to do so in public. He approaches the girl, and she naïvely tells him where she is going. <p>He suggests the girl pick some flowers, which she does. In the meantime, he goes to the grandmother's house and gains entry by pretending to be the girl.</p> He swallows the grandmother whole, and waits for the girl, disguised as the grandmother.</p>
After loading this into editor it's changing into :
<p>
A wolf wants to eat the girl but is afraid to do so in public. He approaches the girl, and she naïvely tells him where she is going.</p>
<p>
He suggests the girl pick some flowers, which she does. In the meantime, he goes to the grandmother's house and gains entry by pretending to be the girl.</p>
<p>
He swallows the grandmother whole, and waits for the girl, disguised as the grandmother.</p>
<p>
</p>
I want to avoid that extra <p> </p>
.
And i have used the below code but no use.
CKEDITOR.on( 'instanceReady', function( ev )
{
ev.editor.dataProcessor.writer.setRules( 'p',
{
indent : false,
breakBeforeOpen : false,
breakAfterOpen : false,
breakBeforeClose : false,
breakAfterClose : false
});
});
Can any one help me..
Upvotes: 1
Views: 1785
Reputation: 15895
Your HTML is invalid! ;)
HTML doesn't allow nesting paragraphs. Try this one and see that everything is fine (no ghost
):
<p>A wolf wants to eat the girl but is afraid to do so in public. He approaches the girl, and she naïvely tells him where she is going.</p>
<p>He suggests the girl pick some flowers, which she does. In the meantime, he goes to the grandmother's house and gains entry by pretending to be the girl.</p>
<p>He swallows the grandmother whole, and waits for the girl, disguised as the grandmother.</p>
Upvotes: 1