function replaceText(
  editorState: EditorState,
  text: string,
  inlineStyle: DraftInlineStyle,
  entityKey: ?string,
  forceSelection: boolean,
): EditorState {
  const contentState = DraftModifier.replaceText(
    editorState.getCurrentContent(),
    editorState.getSelection(),
    text,
    inlineStyle,
    entityKey,
  );
  return EditorState.push(
    editorState,
    contentState,
    'insert-characters',
    forceSelection,
  );
}
Replace the current selection with the specified text string, with the
inline style and entity key applied to the newly inserted text.