Remove caret position and selection markup for test from text or selection