Thank you for contacting us.
I am a bit confused about your scenario. Could you please describe exactly what you are trying to achieve? I also notice that you are trying to convert a selected text to a single span which is not a valid scenario in case you have a text on several new lines as you have shown in attached image "3.jpg". If you debug this code
Span spanSelectedText =
you will notice that the spanSelectedText.Text
will look like this "My Word1\r\nMy Word2\r\nMy Word3"
which makes the span invalid.
I hope this information was helpful. Let me know if you need further assistance.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.