When using serializeHtml how to preserve text color and background colors #2915
Unanswered
kumarajay0412
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am not able to preserve the colors
i am getting this as output
for this
[
{
"id": "1",
"type": "p",
"children": [
{
"text": "Hello, "
},
{
"text": "World",
"color": "#783F04"
},
{
"text": "! "
},
{
"text": "dfdf",
"backgroundColor": "#1300FF"
}
]
}
]
I am doing this
`const editorState = useEditorState();
const html = serializeHtml(editorState, {
nodes: editorData,
dndWrapper: (props) => <DndProvider backend={HTML5Backend} {...props} />
});`
Beta Was this translation helpful? Give feedback.
All reactions