We embed the 4.2 editor in our application and have a need to ensure that all formatted text other than Arial, 10pt, black (our css default) is wrapped in span tags. This works well but we have a problem when initializing an empty editor. We currently use setData() to put in formatted html <p><span style="font-size:..;font-family:..."> </span></p>.
We had to put in the   so when the user starts typing they get formatted text. There are a number of problems with this approach. In Firefox initial text is in the right format, but if you hit home, then end the formatting is lost. In IE 10 initial text starts after the space. There is a space initially in the editor which is ugly by itself.... etc etc.
Here is an example: http://jsfiddle.net/46DPU/
We had gone through a lot of tweaks to get a similar approach to work with FCKEditor and now we have upgraded to v4.2.
Our application exports the content of the editor to other programs that translate HTML to RTF and expect this format, so setting the css on a parent element (better) approach would be a lot more difficult at this point and I am wondering if anyone has a better idea of what to set as formatted html so new text in an empty editor is formatted correctly.
Maybe you have a different approach altogether, maybe there is an API for this. If so, I'm sorry that I have not been able to find it.
We need to support IE8+,FF,Chrome,Safari.
Thank you for any help or suggestions you may provide.
Kind Regards
Looks like the editor puts in
Looks like the editor puts in '<span style="display: none;" data-cke-bookmark="1"> </span>' in some cases. That seems to work okay but there is still some weirdness if the focus is moved into that span. Focus could move there either by the end key or an arrow key, or some other method. When that happens characters in the display:none span do not show. I'll probably check for this when selectionChange fires.
Found this also http://dev.ckeditor.com/ticket/7530