export const Serialize = ({content, config = {}}: { content: any, config?: SlateToReactConfig }) => {
return (
<SlateToReact
node={content}
config={{
...payloadSlateToReactConfig,
markMap: {
strikethrough: ['s'],
bold : ['strong'],
underline : ['u'],
italic : ['i'],
code : ['code'],
},
react : {
...payloadSlateToReactConfig.react,
markMap : {
strikethrough: ['s'],
bold : ['strong'],
underline : ['u'],
italic : ['i'],
code : ['code'],
},
elementTransforms: {
...payloadSlateToReactConfig.elementTransforms,
upload: ({node, attribs, children}) => {
if (node.value?.mimeType && node.value?.url) {
if (node.value?.mimeType.match(/^image/)) {
return (
<img
src={node.value.url}
alt={node.value.alt || node.value.filename}
className={"w-full border-2"}
/>
);
}
}
return;
}
},
},
...config,
alwaysEncodeBreakingEntities: false,
html : {
...payloadSlateToReactConfig.html,
markMap : {
strikethrough: ['s'],
bold : ['strong'],
underline : ['u'],
italic : ['i'],
code : ['code'],
},
alwaysEncodeBreakingEntities: false,
}
}}
/>
);
};
I tried putting those settings (
markMapor evenalwaysEncodeBreakingEntities) everywhere with no effect:What is the correct way?