Preserve the direct cursor style when spliting at the end of paragraph.

At the moment, spliting at the end of the following paragraph
<p style-name="standard">hello <span style-name="bold">world|</span></p>
will create a new paragraph like below
<p style-name="standard">|<span style-name="bold"></span></p>

The cursor is moved out of the span due to empty span is not considered as
a valid cursor position in the current design. this causes newly entered
text are not formatted corretly.

The workaround: first merge the paragrpah style and direct cursor style (if any) into a new automatic style; and then apply it to the newly created paragrpah.