Move checks for contentEditable to isInsertMode to reduce complexity