Hi there,
When i try to render html in the Editor using ConfluenceTransformer I am getting this error:
Error processing value: <p> test test</p> isn't a valid JSON
I see that the Editor accept only JSON data ,but I thought setting the contentTransformerProvider will handle the transfomraiton from JSON to HTML.
My code:
const createPreset = () =>
new EditorPresetBuilder()
.add(basePlugin)
.add(analyticsPlugin)
.add(blockTypePlugin)
.add(listPlugin)
.add(textFormattingPlugin);
const {editorApi, preset} = usePreset(createPreset);
const transformer = useMemo(() =>
editorApi?.core?.actions?.createTransformer((schema) => new ConfluenceTransformer(schema))
, [editorApi]);
<ComposableEditor
contentTransformerProvider={transformer}
defaultValue="<p> test test</p>"
preset={preset}
onChange={() => {
editorApi?.core?.actions.requestDocument(doc => {
setRemediation(doc);
}, {transformer});
}}
/>
How to fix this issue?
Thank you