In the following structure:
<div contenteditable="true"> <span class="some-class">Hello</span> World <!-- no span here --> <span class="some-other-class">and good bye!</span> </div> Is it possible to remove selected span elements, but not the text node, without interrupting the cursor position in the contenteditable div?
So even if the cursor is inside the span, keep the same text content, but just remove the span elements around it
For example if the styling of some-class is red text color and I put the cursor somewhere inside the word "Hello", then I want the styling to be gone and remove the wrapping span