I'm using CKEditor version 4.0 and Firefox 22.
I have manually inserted a text in the WYSIWYG mode: "some text"; in the Source mode, the text is "<p>some text</p>".
If I programatically insert text via "insertText()" or "insertHtml()" functions and the CKEditor instance has no focus, unnecessary <p> tags are added before and after the inserted text.
Scenario:
- the text inside CKEditor WYSIWYG mode is "some text" (the Source mode contains "<p>some text</p>")
- call "insertText('param')" function, while there is no focus inside CKEditor instance
- the Source mode contains "<p>param</p><p>some text</p>"
If I set the focus at the beginning of the text and call "insertText('param')", the Source mode contains "<p>paramsome text</p>"
This issue was reported also here http://dev.ckeditor.com/ticket/1605, but in a slightly different scenario.