I am new on Draft-JS and able to create a decent enough text editor for my consumption, But I need to add a UL list with LI items at the bottom of my Textarea by coding.
I have tried using Import HTML and then adding my HTML into it and then Exporting it back to the editor state, But Undo and Redo are not working like this. I may sound strange but your help will be highly appreciated as I am unable to find good resources of Draft-JS
My Code for adding html which I am currently using is:
let currentHTML = stateToHTML(this.state.editorState.getCurrentContent());
currentHTML = currentHTML + "<li>" + value +"</li>"
let contentState = stateFromHTML(currentHTML);
this.setState({editorState : editorState.createWithContent(contentState)});
In the above code I am taking html from the editor state and then append the desired html string and regenerate the content state from html and edit the editor state. Thank You..