text editor - implement helper to initialize the editor state depending on the input format (HTML, draftjs, or slatejs)