I am using ckeditor 4.4.4, I create an instance of the editor and then set some html data using the code:
$('#test1').ckeditor(function () {
var value = ' <p>Some text</p><p>Some other text</p>';
instance = this;
instance.setData(value, function () { });
}, { });
But then I see an empty line at the beginning of the editor. If I inspect the source code of the data I have set (inside the editor), it says:
<p> </p>
<p>Some text</p>
<p>Some other text</p>
As you can see there is an extra <p></p> tag at the beginning which was not present in my original code. I saw on internet and this forum lots of similar posts, but none of them regarding my case in particular: I have freaked around a bit with 'enterMode', 'allowedContent' and 'autoParagraph' settings but to no avail.
I have tested this with Chrome, FF and IE 11.
Is this a bug or am I doing something wrong? Is there a fix for this? Thank you.
It turns out I had some extra
It turns out I had some extra Unicode character that I did not see in my html code but found out when I took a look at the source code of the page... a simple trim() of the value before setting it to the editor solved the issue.
Thanks for sharing. It might
Thanks for sharing. It might help someone in the future. This problems comes up more often than you think.
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!