I'm developing a react
app, using redux
and electron
. As I was programming an editor with INLINETEX support along with draft.js
and the draft-js-mathjax-plugin, the necessity of saving my editor state showed up. So I'm converting the ContentState
to Raw in order to save that state to a database:
const testContent = convertToRaw(this.state.editorState.getCurrentContent())
And posteriorly converting it again to a ContentState
:
const testState = EditorState.createWithContent(convertFromRaw(testContent))
With the convertToRaw
and convertFromRaw
methods, the inline style is lost, and only blocks of TeX
can be created. That doesn't happen if no conversion is made. Any idea why this is happening?